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.net function rgb2cmyk($var1,$g=0,$b=0) { if (is_array($var1)) { $r = $var1['r']; $g = $var1['g']; $b = $var1['b']; } else { $r=$var1; } $cyan = 255 - $r; $magenta = 255 - $g; $yellow = 255 - $b; $black = min($cyan, $magenta, $yellow); $cyan = @(($cyan - $black) / (255 - $black)) * 255; $magenta = @(($magenta - $black) / (255 - $black)) * 255; $yellow = @(($yellow - $black) / (255 - $black)) * 255; return array('c' => $cyan / 255, 'm' => $magenta / 255, 'y' => $yellow / 255, 'k' => $black / 255); } $color=rgb2cmyk(hex2rgb('#FF0000'));
以上是小编为您精心准备的的内容,在的博客、问答、公众号、人物、课程等栏目也有的相关内容,欢迎继续使用右上角搜索按钮进行搜索CMYK颜色值
RGB颜色
rgb转cmyk颜色不变、rgb改cmyk颜色不变、cmyk与rgb颜色对照表、ai颜色模式cmyk和rgb、rgb颜色和cmyk颜色,以便于您获取更多的相关知识。
时间: 2024-11-13 08:36:56