4 ms·
Show HN: Distinct Color Palette generator using Red-Yellow-Blue colorspace
- jmelloy 15y agoNeat. By pure happenstance, I needed a bunch of colors for plots and state diagrams yesterday.
- MartinCron 15y agoThis 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).
- guard-of-terra 15y agoI press the generate button and then nothing happens. Firefox here.
- friggeri 15y agoFixed by removing the generate button, it was totally useless anyway as the update happens directly when you change the number of colors to generate.
- guard-of-terra 15y agoI change and change it but nothing happens.
- friggeri 15y agoWhat version of firefox are you running ?
- guard-of-terra 15y agoThat was 5.0 I guess. It does work on 10.0.
- drv 15y agoThe "ceiling" symbols (left/right square bracket upper corner) at the beginning of the explanatory text are displayed as unknown character boxes here (Win7/Chrome).
- lbotos 15y agoI'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?)
- friggeri 15y agoNot 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.
- justincormack 15y agoThe browser is supposed to find a font that does have them in that case, so I guess no font does. Ssame on iPad.
- lbotos 15y agoCan 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.
- justincormack 15y agoIt is quoted in various places eg http://www.cs.tut.fi/~jkorpela/html/characters.html http://www.cs.tut.fi/~jkorpela/html/characters.html although some sources eg http://books.google.co.uk/books?id=lxndiWaFMvMC&pg=PA65&lpg=PA65&dq=special+characters+unicode+fallback+browser&source=bl&ots=Nbuu4GQ4EA&sig=06eG-O4LzWsuWMf06QQjn1tKhEA&hl=en&sa=X&ei=cXeIT-6_A4nT0QXF14TMCQ&ved=0CA0Q6AEwAA#v=onepage&q&f=false http://books.google.co.uk/books?id=lxndiWaFMvMC&pg=PA65&... says that IE does not do this. Still looking for original spec though.
- mistercow 15y agoIt would be neat if you could add different color models to optimize for different kinds of color blindness.
- friggeri 15y agoDo you have any reference for that ? (mathematical models of color blindness) ?
- mistercow 15y agoThis 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/000761444.pdf?sequence=1 http://www.lume.ufrgs.br/bitstream/handle/10183/26950/000761...
- dredmorbius 15y agoSimilar 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 { 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) ) }
- inconditus 15y agoWhat's pretty cool is that if you generate 1000+ the colors begin to become muted and look "foresty". Why's this?
- friggeri 15y agoBecause 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.
- malandrew 15y agoWhy not use CIE L*ab, since that colorimetric system is based on human perception or difference?