Best color scheme for colors
I am using colors in CSS and there are multiple options like HEX, HSL, HSB, RGB etc., I wanna ask, which one is used by professionals and which is considered to be the best practice to use?
15 Replies
hex and rgb are the most widely used
what about HSL, is it better than HEX and RGB?
Depends what you are doing. New spaces are OKLAB and OKLCH. Those are better for gradients and mixing colors.
i wouldn't really say there is a better or worse one. like, if you are using a color wheel, hsl makes a lot of sense visually, but when coding stuff out most of the time you don't need anything like that
Still if you are looking into the color space of CSS I would take a look at CSS Color Module Level 4.
so which one I should use then?
if you are just starting out you will probably want to use hex, since it is the most widely used. rgb and hex are different ways of conveying the same thing, so you could also go with that if you'd like
you aren't tied down to just using one and ignoring all the others lol
Thank you rook
I find hsl the easiest to use you pick a hue and then play with saturation and lightness
I finds it the same
hex hsl and rbg are interchangeable so use the one you are most comfortable with 🙂
^^^
i agree that hsl is the most intuitive option for me
For those of us out of the loop... what exactly does "CSS Color Module Level 4" mean?
So the CSS working group has been hard at work to update and improve the way colors are rendered on the web. The way it is currently used by many has been the way since the end of the 90's. Colors and encoding for it has come leaps and bounds in others fields, like graphic design, film, television, camera's, monitors. The RGB color range is quite a narrow band of colors a lot of new monitors are able to display. It's not necessarily my area of expertise, but i have been diving into this over the past few weeks. Needless to say, a lot has happened in recent years.
Indeed, these last couple of years it almost feels like whenever I turn around CSS gets a ton of new features.