How to convert CMYK Color value to RGB Color by PHP
This article introduces the relevant knowledge of "how to convert CMYK color values and RGB colors by PHP". In the operation of actual cases, many people will encounter such a dilemma, so let the editor lead you to learn how to deal with these situations. I hope you can read it carefully and be able to achieve something!
Function hex2rgb ($hex) {$color = str_replace ('#','', $hex); $rgb = array ('r' = > hexdec (substr ($color,0,2)),'g' = > hexdec (substr ($color,2,2)),'b' = > hexdec (substr ($color,4,2)); return $rgb;} / / www.jb51.netfunction rgb2cmyk ($var1,$g=0,$b=0) {if (is_array ($var1)) {$r = $var1 ['r']; $g = $var1 ['g']; $b= $var1 ['b'] } else {$ringing black var1;} $cyan = $rtinctress magenta = 255g politic black = min ($cyan, $magenta, $yellow); $cyan = @ (($cyan-$black) / (255x-$black)) * 255Victory magenta = @ (($magenta-$black) / (255x-$black)) * 255scapeyellow = @ (($yellow-$black) / (255x-$black)) Return array ('c'= > $cyan / 255 black / 255);} $color=rgb2cmyk (hex2rgb ('# FF0000')); "how to convert CMYK color values into RGB colors by PHP" is here. Thank you for your reading. If you want to know more about the industry, you can follow the website, the editor will output more high-quality practical articles for you!