
-----------------------------------
GlobeTrotter
Sun Oct 16, 2005 5:32 pm

Colours to Avoid Using WhatDotColour
-----------------------------------
This program shows you the colours that don't return themselves when whatdotcoloured.  It can be useful to avoid these colours when using whatdotcolour.


var R, G, B : real

var BadColours : flexible array 1 .. 0 of
    record
        putCol : int
        getCol : int
    end record

for i : 0 .. maxcolor
    drawdot (1, 1, i)
    if whatdotcolour (1, 1) ~= i then
        new BadColours, upper (BadColours) + 1
        BadColours (upper (BadColours)).putCol := i
        BadColours (upper (BadColours)).getCol := whatdotcolour (1, 1)
    end if
end for

cls

for i : lower (BadColours) .. upper (BadColours)
    RGB.GetColor (BadColours (i).putCol, R, G, B)
    %if (R + G + B) / 3 >= 0.5 then
    %    colour (7)
    %else
    %    colour (0)
    %end if
    colorback (BadColours (i).putCol)
    color (RGB.AddColor (1 - R, 1 - G, 1 - G))
    put BadColours (i).putCol, " -> ", BadColours (i).getCol
end for


-----------------------------------
Mr. T
Sun Oct 16, 2005 5:38 pm

Alex's Opinion
-----------------------------------
Useful, thanks. 8)

-----------------------------------
[Gandalf]
Sun Oct 16, 2005 7:28 pm


-----------------------------------
They don't return themselves because they are the exact same colour as something lower.  If you want more specific colours, don't use whatdotcolour, and use RBG.*
