static function rgb2hex($rgb) { return '#' . sprintf('%02x', $rgb[0]) . sprintf('%02x', $rgb[1]) . sprintf('%02x', $rgb[2]); }
/** * Convert palette to array of hex colors * * @param $palette * @return array */ private function _paletteToHex($palette) { $r = array(); foreach ($palette as $paletteColor) { array_push($r, Imager_ColorService::rgb2hex($paletteColor)); } return $r; }