Live data from Hacker News

The Code Side Of Color

coding.smashingmagazine.com

31–40 of 40 posts

Re: The Code Side Of Color

#31

Trying to work with color in RGB triplets is like trying to assemble furniture with a plastic fork. Any discussion of color for programmers needs to be in terms of HSL, with a discussion of Lab for completeness and RGB for dealing with legacy systems.

Trying to work with color in RGB triplets is like trying to assemble furniture with a plastic fork.

Agreed, but while HSL is surely more intuitive than RGB, it is still a relatively crude tool because the numbers typically aren’t calibrated in any useful way.

After studying colour theory for a long time, I became convinced that the most interesting colour systems are often those based on actual human perception rather than “arbitrary” physics or mathematics. See for example Munsell’s work[1], which is built around perceptually uniform changes as the values representing colours vary, or the Opponent Process theory[2], where hues are represented in terms of red-green and blue-yellow axes rather than placing three primary colours at the vertices of an equilateral triangle and then interpolating into a circle.

Personally, I have found the perceptual systems more useful than RGB or a traditional colour wheel and something like HSL built on it, particularly for technical/mechanical tasks that require generating variations of colours starting from one or more known anchor points like colours lifted from a photograph or a client’s branding guidelines. I think you always need a human touch, though: all useful colour models have multiple dimensions, and there is definitely both skill and art in making choices like whether to vary each dimension by large amounts, subtle but visible differences, or not at all.

Sadly, I fear we’re still many years from calibrated/environmentally-aware display devices being the norm. That means for something like web design, the majority of visitors to most sites are going to see all those lovingly chosen colours on a poorly calibrated screen that may scarcely resemble the original designer’s choices anyway, so to some extent trying hard to refine a colour scheme at the above level is mostly wasted effort, at least for now. Such is life. :-)

[1] http://en.wikipedia.org/wiki/Munsell_color_system

[2] http://en.wikipedia.org/wiki/Opponent_process

Re: The Code Side Of Color

#32
post #20

Earlier quoted context omitted.

Maybe I'm getting old, though I'm not even 30 yet, but I've never grasped HSL like I have RGB and RGBA. I come from a background of toying with OpenGL and game programming, so it became habitual as that was the required structure ~10 years ago.

With openGL, DirectX, and other real-time rendering I believe sRGB or linear gamma are preferred because there are library and possibly hardware primitives that can be taken advantage of. Outside of that I feel we should be notating color in terms of the L* a* b* colors

Using LAB wouldn't be so bad. It'd take quite some adjustment though.

Re: The Code Side Of Color

#33

Excellent read. I've been interested in developing some sort of tool to help me select, save, and organize colors for custom palettes. This will definitely help -- thanks!

Completely disagree - it was an awful read, but please try http://www.colourlovers.com/ for the selecting, saving and organising of colours.

Colour Lovers is great for picking palettes, but TERRIBLE for mixing colors together.

Thanks. Sorry you didn't find the article interesting.

Re: The Code Side Of Color

#34

Excellent read. I've been interested in developing some sort of tool to help me select, save, and organize colors for custom palettes. This will definitely help -- thanks!

Completely disagree - it was an awful read, but please try http://www.colourlovers.com/ for the selecting, saving and organising of colours.

Colour Lovers is great for picking palettes, but TERRIBLE for mixing colors together.

Thanks. Sorry you didn't find the article interesting.

I never thought I'd be down voted for havi g the opinion that something was great.

You are a SHINING example of why HN comments are such awful places these days.

Re: The Code Side Of Color

#35
post #19
post #9

I'm all for designers learning a bit of the technical background behind colors on the web, but this article is full of technical inaccuracies, misconceptions, and misleading comparisons. "Tens place"? "24-bit color" ignores alpha and color palettes "# means 'This is a hex number'": No, it means a web color expressed as 3 hex numbers. Plus, I know it looks better to make your colors less saturated, but when you are de…

I have to disagree with how critical you're being. Yes, proof-reading is highly important, but he's writing an article for rather untechnical people (that is the audience: people that don't understand hexadecimal representation of colors). There's no guarantee that these folks know base-16, that RGB means bytes representing each color in said order, or even how that maps to a monitor. While the original article is so…

As a programmer interested in design, I didn't mind the inaccuracies. To my shame, I didn't even noticed them.

But I found the article to be quite good and useful, and it's obvious that the guy had all the good intentions.

Re: The Code Side Of Color

#36
post #27

Earlier quoted context omitted.

I understand you meant that in jest but base 1 is possible, albeit very cumbersome: 1 = 1 2 = 11 3 = 111 4 = 1111 ...etc.

Sorry for the nitpick, but that's not really "base 1". It is "unary", which is completely different encoding than the "positional notations" such as decimal, octal, binary, etc. The positional notation doesn't work with base 1, as in that notation there would be only 0, and 0, 00, 000, etc., which all mean the same number: zero.

That I agree on, it is conceptually different (and more primitive); the whole conversation just reminded me of GEB.

Re: The Code Side Of Color

#37
post #2

Bleh, it seems they forgot to proof this or have it read by someone who ... I don't know, maybe knows a bit more about how it really works. When computers name a color, they use a so-called hexidecimal code that most humans gloss over: 24-bit colors. That is, 16,777,216 unique combinations of exactly seven characters made from ten numerals and six letters — preceded by a hash mark. I mean, "hexidecimal" is hopefully…

This mistake was corrected 30 minutes after the article was published. The article went through two technical reviews but apparently such mistakes still happen. Thanks for bringing it to our attention — the wording was incorrect.

Re: The Code Side Of Color

#38
post #20

Earlier quoted context omitted.

Maybe I'm getting old, though I'm not even 30 yet, but I've never grasped HSL like I have RGB and RGBA. I come from a background of toying with OpenGL and game programming, so it became habitual as that was the required structure ~10 years ago.

With openGL, DirectX, and other real-time rendering I believe sRGB or linear gamma are preferred because there are library and possibly hardware primitives that can be taken advantage of. Outside of that I feel we should be notating color in terms of the L* a* b* colors

Web browsers also seem to be using RGB for storing colors internally. You can specify colors in HSL, but retrieved values are only in RGB. E.g. if you write "hsl(100,0%,0%)" in your CSS file then the color will be represented as #000000 in DOM/CSSOM. This is especially annoying when you are trying to implement color picker because information about hue is lost if saturation or lightness are low.

Re: The Code Side Of Color

#39

Earlier quoted context omitted.

Completely disagree - it was an awful read, but please try http://www.colourlovers.com/ for the selecting, saving and organising of colours.

Colour Lovers is great for picking palettes, but TERRIBLE for mixing colors together. Thanks. Sorry you didn't find the article interesting. I never thought I'd be down voted for havi g the opinion that something was great. You are a SHINING example of why HN comments are such awful places these days.

What's wrong with down voting to indicate disagreement? I wouldn't have commented unless I had something constructive to say.

Re: The Code Side Of Color

#40

Earlier quoted context omitted.

Completely disagree - it was an awful read, but please try http://www.colourlovers.com/ for the selecting, saving and organising of colours.

Colour Lovers is great for picking palettes, but TERRIBLE for mixing colors together. Thanks. Sorry you didn't find the article interesting. I never thought I'd be down voted for havi g the opinion that something was great. You are a SHINING example of why HN comments are such awful places these days.

Not only does Colourlovers have tools for what you're complaining about (which is rarely something a computer can do to begin with outside of using equations to do so), but the other commenter was legitimately trying to point you towards a better solution. Ironically, instead of thanking him, you berate him and then called him the reason this place sucks. Yikes.
Post reply on HN