l.color = l._colors.Dim+l._colors.FgRed;
335613
function _normaliseExt(ext) { // we don't use '.' in our extension info... but some might leak in here and there
	ext = (ext||'').trim();
	if (ext.length && ext[0]=='.') 
		return ext.substr(1);
	return ext;
}
1042762
def parse_color(color):
    
    r = g = b = a = type = None
    if color.startswith('#'):
        color = color[1:]
        if len(color) == 3:
            type = '#rgb'
            color = color + 'f'
        if len(color) == 4:
            type = type or '#rgba'
            color = ''.join([c * 2 for c in color])
        if len(color) == 6:
            type = type or '#rrggbb'
            color = color + 'ff'
        assert len(color) == 8
        type = type or '#rrggbbaa'
        r, g, b, a = [
            int(''.join(c), 16) for c in zip(color[::2], color[1::2])
        ]
        a /= 255
    elif color.startswith('rgb('):
        type = 'rgb'
        color = color[4:-1]
        r, g, b, a = [int(c) for c in color.split(',')] + [1]
    elif color.startswith('rgba('):
        type = 'rgba'
        color = color[5:-1]
        r, g, b, a = [int(c) for c in color.split(',')[:-1]
                      ] + [float(color.split(',')[-1])]
    return r, g, b, a, type
550136
function parseSimpleColor(color) {
	color = normalizeColor(color);
	var matches = /^rgb\(([0-9]+), ([0-9]+), ([0-9]+)\)$/.exec(color);
	if (matches) {
		return "#"
			+ parseInt(matches[1]).toString(16).replace(/^.$/, "0$&")
			+ parseInt(matches[2]).toString(16).replace(/^.$/, "0$&")
			+ parseInt(matches[3]).toString(16).replace(/^.$/, "0$&");
	}
	return null;
}
921146
function ( color ) {
            var rgba = {};
            color.replace( this.REG_RGB, function ( str, r, g, b, a ) {
                rgba = {r: Number(r), g: Number(g), b: Number(b), a: 1};
                if ( a ) rgba.a = Number(a);
            });
            return rgba;
        }
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;
    }
}
1264794
function LGraphTextureColor() {
            this.addOutput("Texture", "Texture");

            this._tex_color = vec4.create();
            this.properties = {
                color: vec4.create(),
                precision: LGraphTexture.DEFAULT
            };
        }
28072
def color=(value)
      case value
        when Integer
          self.color_argb = value
        when Gosu::Color
          self.color_argb = value.to_i
        when Array
          self.color_argb = Gosu::Color.from_opengl value
        else
          raise TypeError, "Expected argb integer, rgba opengl float array or Gosu::Color"
      end

      value
    end
129528
function(color) {
				if (!color || color === "") {
					return _colorLookup.black;
				} else if (_colorLookup[color]) {
					return _colorLookup[color];
				} else if (typeof(color) === "number") {
					return [color >> 16, (color >> 8) & 255, color & 255];
				} else if (color.charAt(0) === "#") {
					if (color.length === 4) { //for shorthand like #9F0
						color = "#" + color.charAt(1) + color.charAt(1) + color.charAt(2) + color.charAt(2) + color.charAt(3) + color.charAt(3);
					}
					color = parseInt(color.substr(1), 16);
					return [color >> 16, (color >> 8) & 255, color & 255];
				} else {
					return color.match(_numExp) || _colorLookup.transparent;
				}
			}
100471
function inerpolateColors(col1, col2, amount) {
  let col1rgb = parseColor(col1);
  let col2rgb = parseColor(col2);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + col2rgb.r * (1-amount)),
    g: Math.min(255, col1rgb.g * amount + col2rgb.g * (1-amount)),
    b: Math.min(255, col1rgb.b * amount + col2rgb.b * (1-amount)),
    a: Math.min(1, col1rgb.a * amount + col2rgb.a * (1-amount))
  });
}
707490
function equalsColors(c1,c2){
  for (var i = 0; i < 4; i++) {
    if(c1[i] !== c2[i])
      return false;
  }
  return true;
}
98217
ColorBuffer pad(ColorBuffer str, int len) {
    int n = str.getVisibleLength();
    while (n < len) {
      str.append(" ");
      n++;
    }

    return append(str);
  }
994744
function luminosity(color){
  utils.assertColor(color);
  color = color.rgba;
  function processChannel(channel) {
    channel = channel / 255;
    return (0.03928 > channel)
      ? channel / 12.92
      : Math.pow(((channel + 0.055) / 1.055), 2.4);
  }
  return new nodes.Unit(
    0.2126 * processChannel(color.r)
    + 0.7152 * processChannel(color.g)
    + 0.0722 * processChannel(color.b)
  );
}
477649
function initColors() {
	var low, high,
	    result = new Uint8Array( 0x1000000 );

	for ( low = 0; low < 0x100; low++ ) {
		for ( high = 0; high < 0x100; high++ ) {
			addTile( low, high );
		}
	}

	return result;

	function addTile( low, high ) {
		var colorLow, colorHigh, color,
		    offset = ( low << 16 ) | ( high << 8 );

		for ( var i = 0; i < 8; i++ ) {
			colorLow = ( low & 1 );
	    	colorHigh = ( high & 1 ) << 1;
	    	color = ( colorHigh | colorLow );

			result[ offset + i ] = color;

			low >>= 1;
	    	high >>= 1;
		}
	}
}
887482
function fromLab(l, a, b) {
    var color = create();
    setLab(color, l, a, b);
    return color;
}
889598
function contrast(color) {
    const rgb = [parseInt(color.substring(1, 3), 16),
      parseInt(color.substring(3, 5), 16),
      parseInt(color.substring(5, 7), 16)];
    for (let i = 0; i < 3; i++) {
      rgb[i] = 255 - rgb[i];
    }
    return `rgb(${rgb[0]}, ${rgb[1]}, ${rgb[2]})`;
  }
409447
def _rgba(r, g, b, a, **kwargs):
    
    return ColorValue((float(r), float(g), float(b), float(a)))
109165
function hslToRgb(h, s, l) {

  h /= 360;
  s /= 100;
  l /= 100;

  var r, g, b;

  if (s === 0) {
    r = g = b = l; // achromatic
  } else {
    var q = l < 0.5 ? l * (1 + s) : l + s - l * s;
    var p = 2 * l - q;
    r = hueToRgb(p, q, h + 1 / 3);
    g = hueToRgb(p, q, h);
    b = hueToRgb(p, q, h - 1 / 3);
  }

  return ({
    r: r * 255,
    g: g * 255,
    b: b * 255
  });
}