Color Space Generator
Design
Part of the work I've been doing for my thesis involves generating
color images from indexed files. This is the same principle as any
indexed image format (like GIF) where each pixel is a number which maps
to a table of red, green, blue values. At the time I knew how to get
the basic 256 colors from the color wheel. The problem was the fact
that my indexed image needed over 100,000 different colors. Of course
generating 100K colors is one thing, making an image that uses so many
colors look good is another. So after a day of digesting color theory
websites I finally understood the concept of a color space, color
models, gamuts and enough on how they go together to make a Java class
that lets me generate a color space where the colors work together.
I've uploaded a zip of the class file here
for anyone who can find some use for it. At the time I was tempted to
add an alpha channel which would cause a gradient around color values,
maybe later. To use the class simply call the generate method, the
arguments are: the starting color offset (0 to 1785), next is the
number of colors to generate, and finally the number of colors to skip
in between.
Enjoy.
The pure color values are on the following offsets:
| Offset | R | G | B |
|---|---|---|---|
| 0 | 255 | 0 | 0 |
| 255 | 255 | 255 | 0 |
| 510 | 0 | 255 | 0 |
| 765 | 0 | 255 | 255 |
| 1020 | 255 | 255 | 255 |
| 1275 | 0 | 255 | 255 |
| 1530 | 0 | 255 | 0 |
| 1785 | 0 | 0 | 0 |



Loading....