There are currently no frequently asked questions associated with this exercise – that’s where you come in! You can contribute to this section by offering your own questions, answers, or clarifications on this exercise. Ask or answer a question by clicking reply () below.
If you’ve had an “aha” moment about the concepts, formatting, syntax, or anything else with this exercise, consider sharing those insights! Teaching others and answering their questions is one of the best ways to learn and stay sharp.
Join the Discussion. Help a fellow learner on their journey.
Ask or answer a question about this exercise by clicking reply () below!
Agree with a comment or answer? Like () to up-vote the contribution!
Well, this is a late reply AND I’m far from being experienced. Hopefully, someone will chime in that has a more experienced answer. From inspecting the open tabs in my browser and a few bookmarked pages, I saw mostly hex being used and then a couple had RGB. I didn’t see any HSL. Is there a certain way that is preferred? I know all are acceptable. Is it just a personal preference?
I don’t like to use hex, it’s not readable and you are not able to specify alpha (opacity). So it’s a lot better to use rgb which can be easily transformed into rgba if you want to add opacity. Hex makes sense when you are working on a really old legacy project that has to support IE6 (for example).
Most of the time I use hsl and hsla. Simply because it is readable. It’s easy to make colour lighter/darker, more/less intense, or even change the hue (if you remember how the colour wheel looks) without needing to use a colour palette, you simply change one of the values (h - hue, s - saturation, l - lightness, a - alpha) and the result of this change is easily predictable.
Above applies to web development. In the data science / machine learning projects it’s common to use different colour spaces. In one of my last projects, I decided to convert all the images that were used as a training data to a Lab colour space because it approximates human vision and that was crucial for the model I was building.
Thanks for the quick response! I see how different projects would require you to come at it from different ways. Understanding how they all work is the important part I suppose so that one could apply what is best suited for the project. HSL does seem the easiest to work with or the easiest to wrap my mind around for sure.
It’s worthwhile to note that RGB and HEX are directly related in that every HEX color has a corresponding rgb() color. Neither have a direct relation with HSL as it is only 22 bit color, not 24. That means there are approximately 5 or 6 possible RGB/HEX values corresponding with each HSL value. We could say that HSL has less saturation (in a very small sense) than the others. The more saturated a color is, the tighter the bandwidth around the central hue.
#FF0000 => satuarted
hsl(0, 100, 100) => less saturated