Lines Matching refs:color
41 * Initializes a new RGB color
43 * @param int|string $red either red channel or the whole color in hex
74 * Creates a new random color
77 * @todo make sure it's a visible color
88 * Return the color as a HTML hex color
97 * Return RGB values of a hex color
99 * @param $color
103 private function Hex2RGB($color) {
104 if(substr($color,0,1) == '#') $color = substr($color, 1);
106 if(strlen($color) == 6) {
108 $color[0].$color[1],
109 $color[2].$color[3],
110 $color[4].$color[5]
112 } elseif(strlen($color) == 3) {
114 $color[0].$color[0],
115 $color[1].$color[1],
116 $color[2].$color[2]
119 throw new InvalidArgumentException("Invalid hex color: ".$color);
130 * Return a new color formed by adding the specified increment to
144 * Returns a string representation of the color
153 * Makes sure the input is a valid color range (0-255)