

Show HN: Eight-Bit Color Picker - bilalq
http://bilalq.github.io/eight-bit-color-picker/

======
chavesn
Unfortunately the colors of the web-safe color palette that we all know[1]
(and hopefully hate) that results from combining 00, 33, 66, 99, CC and FF
into triplet permutations has extremely poor color distribution.

Can you find any oranges in that color picker? Maybe 2. What about blues or
reds? Pretty much the same. But you can find a ton of teals, purples, and
pinks!

This is because producing naive permutations of fixed steps results mostly in
muddy hue variance _between_ the primaries. This is not the natural way we see
color variance. It results in far too many unique hues and not enough shades
of the "good" hues ("red", "orange", "yellow", etc.). We only really
distinguish between 7-15 hues at a basic level, but then we are used to seeing
many shades of those same hues.

In addition, because the way the permutations are created it would be a ton of
work to figure out how to sort them by hue. And if you did, you would notice
just how many hues there are (way too many to care about having so many).

A much better color picker will take just a handful of hues (again, 7-15 or
so) and then present varying shades (lighter, usually, but also darker for
more variance) of them. Another crucial factor is to make sure the color
picker includes a row for all shades from black to white (which at least this
color picker has done).

For an example of a color picker that does this well with just a handful of
colors, see the Google docs color picker.[2] You'll notice how much more
pleasing it is to the eye.

[1]: [http://en.wikipedia.org/wiki/Web_colors#Web-
safe_colors](http://en.wikipedia.org/wiki/Web_colors#Web-safe_colors)

[2]:
[https://www.google.com/help/hc/images/docs/docs_1696586_colo...](https://www.google.com/help/hc/images/docs/docs_1696586_color_picker_en.gif)

~~~
bilalq
All excellent points! However, the default palette here is not based on the
web safe colors, but on the colors from xterm-256color. More importantly, the
palette is entirely customizable on a per instance basis of this picker. You
can use this component to build something similar to the one from the Google
docs picker just by passing in a string array of the palette.

My primary motivation for building this was to help applications that target
CLIs. Things like colorscheme generators/editors for vim & emacs can benefit
greatly from this.

------
PhasmaFelis
What is this for? I'm not being snarky; I can't figure out what the use case
is and I'm curious.

~~~
bilalq
While most applications these days can display millions of colors, many
developers use one that is restricted to just 256 colors on a day to day
basis: their terminal. (Yes, technically iTerm and and a few others can
display millions of colors, but the $TERM cannot).

What's more, is that the palette for those colors tends to be different based
on configurations in XResources and the like, so it needs to be able to
support custom palettes.

I built this with the intention to use it as a component in my rewrite of
Villustrator[1], a vim colorscheme generator. I'm going to rebuild it with CLI
vim as its sole focus.

Of course, this can also be used for retro art web apps and the like.

[1]: [http://villustrator.com/](http://villustrator.com/)

