Color문자열 ("hex", "rgb", "rgba", "hsl", "hsla", "keyword")을 해당 Type Color문자열로 변환하여 반환.
@param	{String}	color		Color문자열
@param	{String}	type		변환할 Color Type, "hex", "rgb", "rgba", "hsl", "hsla"
@return	{String}	Color문자열 "hex", "rgb", "rgba", "hsl", "hsla"
775296
function ( color, type ) {
            switch ( type ) {
                case 'rgb':
                    return this.toRgb( color );
                    break;
                case 'rgba':
                    return this.toRgba( color );
                    break;
                case 'hsl':
                    return this.toHsl( color );
                    break;
                case 'hsla':
                    return this.toHsla( color );
                    break;
                default:
                    return this.toHex( color );
                    break;
            }
        }
101920
static String getHex(Color color) {
        return String.format("#%02x%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue(), color.getAlpha());
    }
290504
function (color) {
            this.glArray[0] = me.Math.clamp(this.glArray[0] + color.glArray[0], 0, 1);
            this.glArray[1] = me.Math.clamp(this.glArray[1] + color.glArray[1], 0, 1);
            this.glArray[2] = me.Math.clamp(this.glArray[2] + color.glArray[2], 0, 1);
            this.glArray[3] = (this.glArray[3] + color.glArray[3]) / 2;

            return this;
        }
1017371
function ( color ) {
            var type = this.type( color, 'color.toHex() : "' + color + '" ' + MSG_NOT_COLOR );
    
            switch ( type ) {
                case 'hex':
                    return color;
                    break;
                case 'rgb':
                case 'rgba':
                    return this.rgbToHex( color );
                    break;
                case 'hsl':
                case 'hsla':
                    color = this.hslToRgb( color );
                    return this.rgbToHex( color );
                    break;
                case 'keyword':
                    return this.keyword( color, 'color.toHex() : "' + color + '" ' + MSG_NOT_COLOR );
                    break;
            }
        }
572172
function (color) {
            return (
                (this.glArray[0] === color.glArray[0]) &&
                (this.glArray[1] === color.glArray[1]) &&
                (this.glArray[2] === color.glArray[2]) &&
                (this.glArray[3] === color.glArray[3])
            );
        }
690761
public static String colorToHex(Color color) {
        return String.format("#%02x%02x%02x", color.getRed(), color.getGreen(), color.getBlue());
    }
325490
function parseValueToColor ( value ) {
	const resolvedColorValue = parseColor(value).rgba;
	return new types.Color(resolvedColorValue[0], resolvedColorValue[1], resolvedColorValue[2], resolvedColorValue[3]);
}
1304923
function Color(color) {
    this._reset();
    if (typeof color === 'string') {
        this.parse(color);
    } else {
        var array;
        if (Array.isArray(color)) {
            array = color;
        } else if (typeof color === 'object' && Array.isArray(color.rgba)) {
            array = color.rgba;
        }
        if (array) {
            for (var i = 0; i < this.rgba.length; i++) {
                this.rgba[i] = array[i];
            }
        }
    }
}
887186
function(rgb) {
		var r,g,b;
		if (typeof(rgb) == 'object') {
			r = rgb.r;
			g = rgb.g;
			b = rgb.b;
		} else if (typeof(rgb.match) == 'function'){
			var parts = rgb.match(/^rgb\((\d+),(\d+),(\d+)\)$/);
			if (parts) {
				r = parts[1];
				g = parts[2];
				b = parts[3];
			}
		}
		if (isNaN(r) || isNaN(b) || isNaN(g)) {
			throw new TL.Error("invalid_rgb_err");
		}
		return "#" + TL.Util.intToHexString(r) + TL.Util.intToHexString(g) + TL.Util.intToHexString(b);
	}
1302755
function generateColor(color) {
    const colorLength = isArray(color) ? color.length : false;
    const recolor = () => color[floor(random() * colorLength)];
    return isString(color) ? () => color : colorLength ? recolor : randomColor;
}
586140
function(str, type){
  var s, code;
  if(type){
    if(!isNaN(type) && 110 > type){
      color = type
    }else{
      color = colors[type] || 0
    }
    s = '\033[' + color + 'm' + str + '\033[0m';
  }else{
    s = new String(str);
    
    for(var key in colors){
      Object.defineProperty(s, key, {
          value: '\033[' + colors[key] + 'm' + str + '\033[0m'
        , enumerable: false
        , writable: false
      })
    }
  }
  return s;
}
1119781
public static String shorthandHex(String color) {
		validateHex(color);
		if (color.length() > 5) {
			StringBuilder shorthandColor = new StringBuilder();
			int startIndex = 0;
			if (color.startsWith("#")) {
				shorthandColor.append("#");
				startIndex++;
			}
			for (; startIndex < color.length(); startIndex += 2) {
				String shorthand = shorthandHexSingle(color.substring(
						startIndex, startIndex + 2));
				if (shorthand.length() > 1) {
					shorthandColor = null;
					break;
				}
				shorthandColor.append(shorthand);
			}
			if (shorthandColor != null) {
				color = shorthandColor.toString();
			}
		}

		return color;
	}
97696
function HSLA_TO_RGBA() {
        var h = this.h();
        var s = this.s();
        var l = this.l();
        var a = this.a();
        var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
        var p = 2 * l - q;
        var hk = h / 360;
        var t = {};
        var rgb = {};

        t.r = hk + 1 / 3;
        t.g = hk;
        t.b = hk - 1 / 3;

        var c;

        for (c in t) {
            t[c] < 0 && t[c] ++;
            t[c] > 1 && t[c] --;
        }

        for (c in t) {
            if (t[c] < 1 / 6) {
                rgb[c] = p + ((q - p) * 6 * t[c]);
            } else if (1 / 6 <= t[c] && t[c] < 0.5) {
                rgb[c] = q;
            } else if (0.5 <= t[c] && t[c] < 2 / 3) {
                rgb[c] = p + ((q - p) * 6 * (2 / 3 - t[c]));
            } else { // t[c] >= 2 / 3
                rgb[c] = p;
            }
            rgb[c] *= 255;
        }

        return kolor.rgba(rgb.r, rgb.g, rgb.b, a);
    }
1325043
function getColor(color)
{
    if (!Array.isArray(color))
    {
        return getSingleColor(color);
    }
    else
    {
        for (let i = 0; i < color.length; ++i)
        {
            color[i] = getSingleColor(color[i]);
        }

        return color;
    }
}
820198
public static function get_colors($type = 'hex')
    {
        $cached = self::$colorsCached;
        if (isset($cached[$type])) return $cached[$type];

        $colors = Config::inst()->get('Identity', 'colors');
        if ($type == 'rgb') {
            $rgbColors = [];
            foreach ($colors as $name => $c) {
                $rgbColors[$name] = self::hex2rgb($c);
            }
            $colors = $rgbColors;
        }
        self::$colorsCached[$type] = $colors;
        return $colors;
    }
374910
function changeDecColorsToHex(color) {
  return color.replace(decimalColorRx, (colorValue, r, g, b) => {
    const hr = changeDecColorToHex(r);
    const hg = changeDecColorToHex(g);
    const hb = changeDecColorToHex(b);

    return `#${hr}${hg}${hb}`;
  });
}
1342379
function parse_BrtColor(data/*::, length*/) {
	var out = {};
	var d = data.read_shift(1);

	//var fValidRGB = d & 1;
	var xColorType = d >>> 1;

	var index = data.read_shift(1);
	var nTS = data.read_shift(2, 'i');
	var bR = data.read_shift(1);
	var bG = data.read_shift(1);
	var bB = data.read_shift(1);
	data.l++; //var bAlpha = data.read_shift(1);

	switch(xColorType) {
		case 0: out.auto = 1; break;
		case 1:
			out.index = index;
			var icv = XLSIcv[index];
			/* automatic pseudo index 81 */
			if(icv) out.rgb = rgb2Hex(icv);
			break;
		case 2:
			/* if(!fValidRGB) throw new Error("invalid"); */
			out.rgb = rgb2Hex([bR, bG, bB]);
			break;
		case 3: out.theme = index; break;
	}
	if(nTS != 0) out.tint = nTS > 0 ? nTS / 32767 : nTS / 32768;

	return out;
}