Beefy Boxes and Bandwidth Generously Provided by pair Networks
XP is just a number
 
PerlMonks  

Re: Contrasting Colours

by TomDLux (Vicar)
on May 29, 2003 at 16:04 UTC ( [id://261581]=note: print w/replies, xml ) Need Help??

Help for this page

Select Code to Download


  1. or download this
    $c1 = [ $r, $g, $b ];
    $c2 = contrasting_colour( @c1 );
    ...
                             255 - $c->[2] );
       return sprintf "#%02X%02X%02X",  $r, $g, $b;
    }
    
  2. or download this
    sub contrasting_colour {
       my ( $c ) = @_;
    ...
                             ($c->[2] + 128) % 256,  );
       return [ $r, $g, $b ];
    }
    

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://261581]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others scrutinizing the Monastery: (4)
As of 2024-04-24 00:37 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found