T.R | Title | User | Personal Name | Date | Lines |
---|
1024.1 | | SIEVAX::JAMIE | Use me, Use me... Ooops! Excuse me! | Tue Dec 04 1990 11:49 | 12 |
| I've since been informed that this is not as easy at it sounds!
Apparently there are lots of horrible equation thingys needed to solve
this!
So I'm going to produce a look-up table instead!!!
Cheers,
Jamie.
|
1024.2 | Is this the sequence you are looking for? | YNOTME::WALLACE | | Wed Dec 05 1990 13:38 | 48 |
| > I want to step through the entire range of possible colours from
> darkest to brightest.
> Try as I might, though, I've have no luck whatsoever. Any ideas ?
At first glance it seemed liked a reasonably trivial problem. At second glance
it seemed not quite so trival but doable. In any case the problem/chalenge
intriqued me so I went to work... And put together a 69 line C program which
generates the 1035 triplets of color combinations.
The program can be copied from OLDTMR::$1$DUA8:[WALLACE.PUBLIC]TEASE.C,.LST,.EXE
Where .C is the source, .EXE is the VMS executible, and .LST is the output of
the program.
Here is an excerpt from the output of the program (first # is just a count of
the triplets, the next three numbers are the color values, red, green, blue) -
21 -> 2 2 2
22 -> 3 0 0
23 -> 0 3 0
24 -> 0 0 3
25 -> 3 1 0
26 -> 3 0 1
27 -> 3 1 1
28 -> 0 3 1
29 -> 1 3 0
30 -> 1 3 1
31 -> 1 0 3
32 -> 0 1 3
33 -> 1 1 3
34 -> 3 2 1
35 -> 3 1 2
36 -> 3 2 2
37 -> 1 3 2
38 -> 2 3 1
39 -> 2 3 2
40 -> 2 1 3
41 -> 1 2 3
42 -> 2 2 3
43 -> 3 3 2
44 -> 3 2 3
45 -> 3 3 3
46 -> 4 0 0
Ray
|
1024.3 | | SIEVAX::JAMIE | Use me, Use me... Ooops! Excuse me! | Mon Dec 10 1990 06:00 | 24 |
| Thanks! That looks like just the biscuit! Though aren't there just 512
"triplets" ?
I had a crack at something like this myself; I found a formula to rate
a triplets brightness according to its RGB value :
luminosity = .299 red + .587 green + .114 blue
When I saw this I thought it would do the trick, so I wrote a program
to produce a lookup table of colours sorted according to luminosity and
displayed them on the screen...
What a mess!!! The trouble with the formula is that it can rate a
colour that's a shade of red as being the closest to a colour that's a
shade of blue - and do they clash ???!!!!
I think .-1 is more like it; a gradual move from one colour to the
next, though it's still best used in a lookup table.
Thanks, Ray.
Jamie.
|
1024.4 | A much improoved version of the program | YNOTME::WALLACE | | Mon Dec 10 1990 15:01 | 22 |
| > Thanks! That looks like just the biscuit! Though aren't there just 512
> "triplets" ?
Right, I wrote the code for 4 bits per color instead of 3. Also there was a
glitch in my calculations so that not all color combinations were being
output. Both of which have been fixed and there are new files available in the
same directory.
> I had a crack at something like this myself; I found a formula to rate
> a triplets brightness according to its RGB value :
> luminosity = .299 red + .587 green + .114 blue
I didn't give any consideration to this.
> I think .-1 is more like it; a gradual move from one colour to the
> next, though it's still best used in a lookup table.
A small change to the output routine at the end of my code could easily
produce the lookup table file (.byte instructions or whatever).
This program does not produce the optimum sequence, but I think it's
close enough, depending on what your going to do with the output.
Ray
|
1024.5 | Hue, Lightness and Saturation | VISUAL::WEAVER | Dave, Image Systems Group | Mon Dec 17 1990 17:43 | 15 |
| There are equations for hue, lightness and saturation, and others that produce
similar results. To do what you want, you will need to compute at least
hue and lightness, but that will limit the values unless you also compute
saturation.
Hue = Color
Lightness = Brightness
Saturation = purity of the color. 0 saturation tends toward gray.
Foley and VanDamm's [sic] book on "Interactive Computer Graphics" (I believe
that is the title) goes into quite a bit of detail. I would expect most
Digital Libraries would have a copy, possibly bigger local libraries might
as well.
-Dave
|