How to programmatically organize a set of 256 RGB to 2D colors so that all adjacent colors have a smooth transition

I have a set of 256 colors (all available colors in the terminal xterm-256color) and I use a script called 256colors2.pl, which I mentioned in almost every article on the Internet that talks about 256 color terminals. This script output is a 6x6x6 cube laid out as a series of 6 6x6 cube pieces, plus a line with gray from black to white.

I am looking for some two-dimensional shape and an appropriate algorithm for rendering these colors in 2D so that all the transitions are smooth. This should be applicable to a reduced set of colors (256 in this case, which includes a limited set of shades of gray).

+4
source share
1 answer

Just a thought (I don’t have a technical solution or algorithm for this) ... you probably want to consider the color wheel. It is commonly used in drawing and visualization applications when the user wants to select a color.

Link: http://en.wikipedia.org/wiki/Color_wheel

Here are some related posts:

Color Wheel Creation Function http://www.javascriptsource.com/page-details/hexadecimal-color-wheel.html
0
source

Source: https://habr.com/ru/post/1394150/


All Articles