function LCh2RGB($LCh) { if ($LCh['L*'] > 100) { $LCh['L*'] = 100; } if ($LCh['L*'] < 0) { $LCh['L*'] = 0; } // if ($LCh['C*']>100) {$LCh['C*']=100;} if ($LCh['C*'] < 0) { $LCh['C*'] = 0; } $LCh['h'] %= 360; $Lab = LCh2Lab($LCh); $rgb = Lab2RGB($Lab); $rgb = array_merge($rgb, $LCh); $rgb['type'] = 'L*C*h'; return $rgb; }
function LCh2RGB($LCh) { list($L, $C, $h) = $LCh; if ($L > 100) { $L = 100; } if ($L < 0) { $L = 0; } // if ($C>100) {$C=100;} if ($C < 0) { $C = 0; } $LCh[0] = $L; $LCh[1] = $C; $LCh[2] = $h %= 360; $Lab = LCh2Lab($LCh); $rgb = Lab2RGB($Lab); $rgb = array_merge($rgb, $LCh); $rgb['type'] = 'L*C*h'; return $rgb; }