0 && $g === 255 && $b === 0) $r--; elseif($r === 0 && $g > 0 && $b === 255) $g--; elseif($r === 255 && $g === 0 && $b > 0) $b--; //DEBUG //$k = $i + 1; //echo "I:$k\t$r,$g,$b\r\n"; } return array($r, $g, $b); } /** * Converts a single char to a string. * @param string $string * @return array RGB */ public function charToColor($string) { if(strlen($string) === 0) throw new Exception("Empty string given!"); $index = ord($string) * 5; $color = $this->index2rgb($index); return $color; } } ?>