Programming C, C++, Java, PHP, Ruby, Turing, VB
Computer Science Canada 
Programming C, C++, Java, PHP, Ruby, Turing, VB  

Username:   Password: 
 RegisterRegister   
 Colours to Avoid Using WhatDotColour
Index -> Programming, Turing -> Turing Submissions
View previous topic Printable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic
Author Message
GlobeTrotter




PostPosted: 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
Sponsor
Sponsor
Sponsor
sponsor
Mr. T




PostPosted: Sun Oct 16, 2005 5:38 pm   Post subject: Alex's Opinion

Useful, thanks. 8)
[Gandalf]




PostPosted: Sun Oct 16, 2005 7:28 pm   Post subject: (No 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.*
Display posts from previous:   
   Index -> Programming, Turing -> Turing Submissions
View previous topic Tell A FriendPrintable versionDownload TopicRate TopicSubscribe to this topicPrivate MessagesRefresh page View next topic

Page 1 of 1  [ 3 Posts ]
Jump to:   


Style:  
Search: