Lines Matching refs:color
12 * Converts an RGB color number to a hex color string if valid.
13 * @param {number} color A 6-digit hex RGB color code as a number.
14 * @return {?string} A CSS representation of the color or null if invalid.
16 function convertToHexColor(color) {
18 // range for an RGB hex color.
19 if (isFinite(color) && Math.floor(color) == color &&
20 color >= 0 && color <= 0xffffff) {
21 var hexColor = color.toString(16);
30 * Validates a RGBA color component. It must be a number between 0 and 255.
40 * Converts an Array of color components into RGBA format "rgba(R,G,B,A)".
41 * @param {Array.<number>} rgbaColor Array of rgba color components.
42 * @return {?string} CSS color in RGBA format or null if invalid.