Beefy Boxes and Bandwidth Generously Provided by pair Networks
Do you know where your variables are?
 
PerlMonks  

Re: Re: Converting CMYK values to RGB values

by Arien (Pilgrim)
on Dec 27, 2002 at 11:50 UTC ( [id://222523]=note: print w/replies, xml ) Need Help??


in reply to Re: Converting CMYK values to RGB values
in thread Converting CMYK values to RGB values

Using map allows for code that is (IMHO) somewhat clearer and more concise.

sub cmyk2rgb { my ($cyan, $magenta, $yellow, $black) = @_; my $white = 255 - $black; use integer; return map $_ > 255 ? 0 : 255 - $_ => map $_ * $white / 255 + $black => ($cyan, $magenta, $yellow); }

— Arien

Log In?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others avoiding work at the Monastery: (2)
As of 2025-01-14 06:05 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (38 votes). Check out past polls.