Show HN: Distinct Color Palette generator using Red-Yellow-Blue colorspace(afriggeri.github.com)
afriggeri.github.com
Show HN: Distinct Color Palette generator using Red-Yellow-Blue colorspace
http://afriggeri.github.com/RYB/
8 comments
Why not use CIE L*ab, since that colorimetric system is based on human perception or difference?
This is really great. I wound up doing something like this by hand (by eye?) the last time I needed to generate a distinct color palette (player colors in an online map game).
I press the generate button and then nothing happens. Firefox here.
Fixed by removing the generate button, it was totally useless anyway as the update happens directly when you change the number of colors to generate.
I change and change it but nothing happens.
What version of firefox are you running ?
That was 5.0 I guess. It does work on 10.0.
The "ceiling" symbols (left/right square bracket upper corner) at the beginning of the explanatory text are displayed as unknown character boxes here (Win7/Chrome).
I'm not the OP but did a little looking at the source. It's encoded as UTF-8 and is rendering fine in Chrome on Mac. Can someone more experienced with Character Encoding chime in? I've always wanted to learn more about how things like this happen. (I assume it's a character encoding issue?)
Not really an encoding problem, I suppose the issue arises because the fallback font does not have those symbols. I can't test on Windows but if someone could point me to a font which has those mathematics characters on Windows I'll gladly specify that font.
The browser is supposed to find a font that does have them in that case, so I guess no font does. Ssame on iPad.
Can you point me to something that shows this? I know font family declarations with multiple fonts will fall back but I've never heard of this before. FWIW, the site only declares one typeface "Lucida Grande" so I assume to browser is falling back to the default Sans-serif on windows.
It is quoted in various places eg http://www.cs.tut.fi/~jkorpela/html/characters.html although some sources eg http://books.google.co.uk/books?id=lxndiWaFMvMC&pg=PA65&... says that IE does not do this. Still looking for original spec though.
Can you try "Lucida Sans Unicode"?
Neat. By pure happenstance, I needed a bunch of colors for plots and state diagrams yesterday.
It would be neat if you could add different color models to optimize for different kinds of color blindness.
Do you have any reference for that ? (mathematical models of color blindness) ?
This thesis[1] might help as a starting point. It is primarily focused on simulating colorblindness for the non-colorblind, and gives some transformations between trichromatic and dichromatic vision.
[1] http://www.lume.ufrgs.br/bitstream/handle/10183/26950/000761...
[1] http://www.lume.ufrgs.br/bitstream/handle/10183/26950/000761...
Similar concept: I like to be able to generate terminals of varying-but-viewable color schemes. I'd like to tweak this to use more an HSV than RGB scheme.
#!/usr/bin/gawk -f
function ranint (x) { return int(rand() * x) } function hex (x) { return sprintf("%02x", x) }
BEGIN {
#!/usr/bin/gawk -f
function ranint (x) { return int(rand() * x) } function hex (x) { return sprintf("%02x", x) }
BEGIN {
mc = 96 # max color
# Seed RNG using nanoseconds
cmd="date +%N"
cmd | getline seed
close(cmd)
srand(seed)
r = ranint(mc)
g = ranint(mc)
b = ranint(mc)
printf( "rxvt -bg \x27#%s%s%s\x27 -fg gold -cr blue &\n", hex(r), hex(g), hex(b) )
}What's pretty cool is that if you generate 1000+ the colors begin to become muted and look "foresty". Why's this?
Because the colors at the end are the one which are closest to the average of all those before. In RYB, the average is what you'd obtain by mixing paints of those colors, so a really earthy tone.