Get the App
SLTechnology News&Howtos  ›  Development  › 

How to convert CMYK Color value to RGB Color by PHP

Shulou Source: shulou.com Published: 2022-06-03 18:02:01 10月03日 Update

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!

Tags: Color content more knowledge practical successful learning next dilemma reality situation article case editing website industry process high quality learning related output Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Microsoft vpn Docker Apple Shulou Information