计算机编程
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'));
其他新闻
  •  安装前的准备: 1.Apache2.2.22.PHP5.2.173.SqlServer20084.sqlncli.msi(SqlServer客户端,可以到微软官方网站去下载)5.ntwdblib.dll (2000.80.194.0)6.SQLSRV20.exe,即MicrosoftDriver 2.0 for PHP for SQL Server(sql server...
    2020-02-10
  • 通常来说在php读取大文件的时候,我们采用的方法一般是一行行来讲取,而不是一次性把文件全部写入内存中,这样会导致php程序卡死,下面就给大家介绍这样一个例子。 paip.文件读写...
    2020-02-10
  • 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 (...
    2020-02-10
友情链接

公司名称巴黎人电玩
版权所有:Copyright © 2015-2019 http://www.zhongqiangjy.com. 巴黎人电玩有限公司 版权所有

友情链接

Copyright © 2015-2019 http://www.zhongqiangjy.com. 巴黎人电玩有限公司 版权所有
公司地址http://www.zhongqiangjy.com