public static function rgbColorFromRatio($ratio) { $color = ""; $hue = ExtraWatchHelper::hueFromRatio($ratio); $rgb = ExtraWatchHelper::HSV_TO_RGB($hue, 1, 1); if ($rgb) { $color = sprintf("#%02x%02x%02x", $rgb['R'], $rgb['G'], $rgb['B']); return $color; } return $color; }