[OT] Round 2: Webpage design and "Name That Color!"

Nick Sabalausky a at a.a
Sun Feb 27 14:33:56 PST 2011


"spir" <denis.spir at gmail.com> wrote in message 
news:mailman.2005.1298820313.4748.digitalmars-d at puremagic.com...
>
> You are right about HSV. The point is its V component only covers half 
> range of 'lightness'. Precicely, it covers from black to the maximal 
> 'natural' lightness of the corresponding 'pure' color of the same hue.
> It may be better when you're dealing with material (substractive) colors, 
> meaning paints. For instance to print it out on paper. Then, the max V 
> component gives the pure color you get out of the paint tube. Maybe it's 
> the reason why older image manipulation software started using HSV; then, 
> the error propagated into newer software (just like in programming 
> languages ;-). But it's easy to get it with HSL as well: just set L to 
> 50%; so, the advantage of HSV with material colors is not that big, I 
> guess.
> But the drawbacks of HSV are painful: since L only covers half of the 
> lightness range, then the rest must be covered somewhere (to get the whole 
> color space): namely, it is taken by the S component. This means that S, 
> which should intuitively allow setting the saturation (I call that 
> "vividness"), in fact also takes a part of lightness: when you move the S 
> cursor, you change both saturation & lightness! Thus, both S and V are 
> messed up. Worse even, I think (not sure) that V is messed up only on its 
> higher part of its range (since for the lower part ligntness is set 
> separately by V). I have never managed to get an accurate mental model of 
> HSV: what is 'S' in HSV? (answers off list welcome ;-) While the mental 
> model of HSL is obvious, trivial (for me at least).
> To sum up: use HSL.
>

Yea, exactly the conclusion I've come to.

> With HSL component scales, it's easier (not easy) to compose nice looking 
> color palettes; especially ones that do not look like a messy (or random) 
> /juxtaposition/ of colors: mainly play with S and/or L.
> As a side-note, /all/ default syntax-highlighting style sheets I have ever 
> seen are horrible from this point of view ;-)

Ie, "programmer art". :)

I've occasionally given a little bit of thought to a syntax-highlighting 
system that's based more on color selecting *and* color mixing rather than 
just color selecting. A problem I've noticed is that there are various 
orthogonal attributes to highlight on, such as whether or not the text is a 
keyword and whether or not the text is selected. Under every system I've 
seen, each combination (and there's an exponential number of combinations) 
has to be manually chosen, and some combinations end up needing to be 
omitted (for instance, syntax highlighting often goes away for selected 
text). But if each "attribute" could have an associated "color equation" 
(like a simplified version of video card blending modes and vertex/pixel 
shaders, or at the very least, an alpha component), then that could make it 
easier to accont for more combintions that look better, without exponential 
blowup in amount of work. For instance, selected text could be specified as 
0x0000FF with 50% alpha instead of just 0x000000 background and 0x0000FF 
foreground. Or if that caused problems with certain underlying colors, then 
maybe an alternate blending mode could be chosen or even written.








More information about the Digitalmars-d mailing list