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
Rook
Rook•17mo ago
hex and rgb are the most widely used
Hamza Naeem
Hamza NaeemOP•17mo ago
what about HSL, is it better than HEX and RGB?
Wouter Schaap
Wouter Schaap•17mo ago
Depends what you are doing. New spaces are OKLAB and OKLCH. Those are better for gradients and mixing colors.
Rook
Rook•17mo ago
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
Wouter Schaap
Wouter Schaap•17mo ago
Still if you are looking into the color space of CSS I would take a look at CSS Color Module Level 4.
Hamza Naeem
Hamza NaeemOP•17mo ago
so which one I should use then?
Rook
Rook•17mo ago
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
Hamza Naeem
Hamza NaeemOP•17mo ago
Thank you rook
Mannix
Mannix•17mo ago
I find hsl the easiest to use you pick a hue and then play with saturation and lightness
Hamza Naeem
Hamza NaeemOP•17mo ago
I finds it the same
Mannix
Mannix•17mo ago
hex hsl and rbg are interchangeable so use the one you are most comfortable with 🙂
Rook
Rook•17mo ago
^^^ i agree that hsl is the most intuitive option for me
Joao
Joao•17mo ago
For those of us out of the loop... what exactly does "CSS Color Module Level 4" mean?
Wouter Schaap
Wouter Schaap•17mo ago
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.
Joao
Joao•17mo ago
Indeed, these last couple of years it almost feels like whenever I turn around CSS gets a ton of new features.
Want results from more Discord servers?
Add your server