Hacker News new | ask | show | jobs
by codazoda 1917 days ago
I prefer to use named colors in my own CSS layouts. "lightsalmon" is more descriptive to me than "#FFA07A" or "rgb(255, 160, 122)" or "hsl(17, 100%, 73.9%)" at a glance.
4 comments

And if you use a CSS pre-processor or—better yet—CSS custom properties you get your descriptive color anyway:

    --text-color: cornsilk;
    --background-color: peru;
Awesome if you're in your office on your usual work computer. Not great if you're in the field trying to make quick fixes on whatever terminal a client provides.
In which reality do you need to monkey patch CSS color values on a terminal directly to production? With no possibility of running a IDE?
I doubt many web developers will ever find themselves "on the field" with someone else's computer and no web browser to work with.
Is there any tool that you can rely on if you're "in the field" on "whatever terminal a client provides?"
> "lightsalmon" is more descriptive to me than "#FFA07A" or "rgb(255, 160, 122)"

While I agree, I feel that learning to look at "#FFA07A" and immediately grok "pink" has been of general benefit to me as a frontend dev.

> or "hsl(17, 100%, 73.9%)" at a glance

I must admit though that I haven't mastered identifying hue by number just yet (though if I do, it will be even better as Saturation and Lightness/Luminosity are much easier to reason about).

I always found hex codes non-intuitive, but the hue values are easy once you just remember:

0 = red

120 = green

240 = blue

Then you just interpolate as desired, so yellow is 60, orange is 30, red-orange is 15.

And really all you need to remember is red = 0 (lowest energy wavelength) and the three RGB primaries are spread evenly around the 360° color wheel, therefore 0, 120, 240.

If you're good at knowing how colors mix, RGB values are also very intuitive, since they're literally in RGB order and the the closer to FF it is, the more of that color is in it.

But I hadn't spent the time to look at hue values, so your chart helped me get better at them.

It's more descriptive, but usually you design UIs for the user, not for the developer writing the CSS
Sorry I don't understand your comment?

This thread is about developers writing CSS...

I have had my favorite hex memorized since about 2012: #07D0EB
Nice, nearly analogous to mine (#004CFF) [0].

[0]: https://duckduckgo.com/?q=%23004cff

Solid, I like that a lot.