Computer Science Canada

Colours to Avoid Using WhatDotColour

Author:  GlobeTrotter [ Sun Oct 16, 2005 5:32 pm ]
Post subject:  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.

code:

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

Author:  Mr. T [ Sun Oct 16, 2005 5:38 pm ]
Post subject:  Alex's Opinion

Useful, thanks. 8)

Author:  [Gandalf] [ Sun Oct 16, 2005 7:28 pm ]
Post subject: 

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.*


: