/*
enums
ZERO
ONE
SRC_COLOR
ONE_MINUS_SRC_COLOR
SRC_ALPHA
ONE_MINUS_SRC_ALPHA
DST_ALPHA
ONE_MINUS_DST_ALPHA
DST_COLOR
ONE_MINUS_DST_COLOR
SRC_ALPHA_SATURATE
9170
function( srcRgb, dstRgb, srcAlpha, dstAlpha ){
    this._dat[ 0|BLEND_FUNC_C_SRC ] = srcRgb;
    this._dat[ 0|BLEND_FUNC_C_DST ] = dstRgb;
    this._dat[ 0|BLEND_FUNC_A_SRC ] = srcAlpha;
    this._dat[ 0|BLEND_FUNC_A_DST ] = dstAlpha;
    this._set |= BLEND_FUNC_SET | BLEND_FUNC_A_SET;
    return this;
  }
674546
function() {
        if (this.hsl !== null) {
            if (this.alpha < 1.0) {
                if (this.perceptual) {
                    return 'rgba(' + hsluv.hsluvToRgb([this.hsl[0], this.hsl[1] * 100, this.hsl[2] * 100]).map(function(c) {
                        return Math.round(c * 255);
                    }).concat(this.round(this.alpha, 2)).join(', ') + ')';
                }
                else {
                    return 'rgba(' + chroma.hsl(this.hsl[0], this.hsl[1], this.hsl[2]).rgb().map(function(c) {
                        return Math.round(c);
                    }).concat(this.round(this.alpha, 2)).join(', ') + ')';
                }
            } else {
                if (this.perceptual) {
                    return hsluv.hsluvToHex([this.hsl[0], this.hsl[1] * 100, this.hsl[2] * 100]);
                }
                else {
                    return chroma.hsl(this.hsl[0], this.hsl[1], this.hsl[2]).hex();
                }
            }
        }
        return '';
    }
1029607
function(color, alpha) {
            var colorAsHex = (typeof color === "number") ? color : this.hexFromColor(color);
            return this.colorFromHex(colorAsHex, alpha);
        }
212946
function shadeColor(col, amount) {
  let col1rgb = parseColor(col);
  return RGBobj2string({
    r: Math.min(255, col1rgb.r * amount + 0 * Math.max(0,1-amount)),
    g: Math.min(255, col1rgb.g * amount + 0 * Math.max(0,1-amount)),
    b: Math.min(255, col1rgb.b * amount + 0 * Math.max(0,1-amount)),
    a: col1rgb.a
  });
}
776915
function parseColor(col) {
  let tmp;
  if (typeof col === 'string') {
    col = col.trim();
    if (col.slice(0,1) === '#') {
      if (col.length === 7) {
        return {
          r: parseInt('0x' + col.substr(1,2)),
          g: parseInt('0x' + col.substr(3,2)),
          b: parseInt('0x' + col.substr(5,2)),
          a: 1
        };
      } else if (col.length === 4) {
        return {
          r: Math.pow(parseInt('0x' + col.substr(1,1))+1,2)-1,
          g: Math.pow(parseInt('0x' + col.substr(2,1))+1,2)-1,
          b: Math.pow(parseInt('0x' + col.substr(3,1))+1,2)-1,
          a: 1
        };
      } else if (col.length === 9) {
        return {
          r: parseInt('0x' + col.substr(1,2)),
          g: parseInt('0x' + col.substr(3,2)),
          b: parseInt('0x' + col.substr(5,2)),
          a: parseInt('0x' + col.substr(7,2)) / 255
        };
      } else if (col.length === 5) {
        return {
          r: Math.pow(parseInt('0x' + col.substr(1,1))+1,2)-1,
          g: Math.pow(parseInt('0x' + col.substr(2,1))+1,2)-1,
          b: Math.pow(parseInt('0x' + col.substr(3,1))+1,2)-1,
          a: parseInt('0x' + col.substr(4,1)) / 15
        };
      }
    } else if (col.slice(0,4) === 'rgba') {
      tmp = col.substr(5).split(',');
      return {
        r: parseInt(tmp[0]),
        g: parseInt(tmp[1]),
        b: parseInt(tmp[2]),
        a: parseFloat(tmp[3])
      };
    } else if (col.slice(0,4) === 'hsla') {
      tmp = col.substr(5).split(',').slice(0,4);
      tmp[0] = tmp[0] / 359;
      tmp[1] = tmp[1].slice(0,-1) / 100;
      tmp[2] = tmp[2].slice(0,-2) / 100;
      tmp = hslaToRgba(...tmp);
      return {
        r: tmp[0],
        g: tmp[1],
        b: tmp[2],
        a: parseFloat(tmp[3])
      };
    } else if (col.slice(0,3) === 'rgb') {
      tmp = col.substr(4).split(',');
      return {
        r: parseInt(tmp[0]),
        g: parseInt(tmp[1]),
        b: parseInt(tmp[2]),
        a: 1
      };
    } else if (col.slice(0,3) === 'hsl') {
      tmp = col.substr(4).split(',').slice(0,3);
      tmp[0] = tmp[0] / 359;
      tmp[1] = tmp[1].slice(0,-1) / 100;
      tmp[2] = tmp[2].slice(0,-2) / 100;
      tmp = hslToRgb(...tmp);
      return {
        r: tmp[0],
        g: tmp[1],
        b: tmp[2],
        a: 1
      };
    } else if (col.slice(0,2) === '0x') {
      return {
          r: parseInt('0x' + col.substr(2,2)),
          g: parseInt('0x' + col.substr(4,2)),
          b: parseInt('0x' + col.substr(6,2)),
          a: parseInt('0x' + col.substr(8,2)) / 255
        };
    } else if (col === 'transparent') {
      return {
          r: 0,
          g: 0,
          b: 0,
          a: 0
        };
    } else if (colorNames.hasOwnProperty(col)) {
      return parseColor(colorNames[col]);
    }
  }
}
313901
function (r, g, b) {
            if (r > 255 || g > 255 || b > 255)
                throw "Invalid color component";
            return ((r << 16) | (g << 8) | b).toString(16);
        }
1079036
function formatBufferColored(err, options) {
    // istanbul ignore else
    if (!hex) {
        return err.buffer.toString('hex');
    }

    options = options || {};
    var opts = options.hexerOptions ? Object.create(options.hexerOptions) : {};
    if (opts.colored === undefined) {
        opts.colored = true;
    }
    var highlight = errorHighlighter(err, options);
    opts.decorateHexen = highlight;
    opts.decorateHuman = highlight;
    return hex(err.buffer, opts);
}
1101539
function convertColorToString(color) {
  const {type, values} = color

  // Only convert the first 3 values to int (i.e. not alpha)
  if (type.indexOf('rgb') > -1)
    for (let i = 0; i < 3; i++) values[i] = parseInt(values[i])

  let colorString

  if (type.indexOf('hsl') > -1)
    colorString = `${color.type}(${values[0]}, ${values[1]}%, ${values[2]}%`
  else colorString = `${color.type}(${values[0]}, ${values[1]}, ${values[2]}`

  if (values.length === 4) colorString += `, ${color.values[3].toFixed(2)})`
  else colorString += ')'

  return colorString
}
599691
function serializeColor(sassColor) {
  const alpha = Math.round(sassColor.getA() * 100) / 100;
  const r = Math.round(sassColor.getR());
  const g = Math.round(sassColor.getG());
  const b = Math.round(sassColor.getB());

  if(alpha < 0.999) {
    return `rgba(${r},${g},${b},${alpha})`;
  } else {
    const hex = `#${toColorHex(r)}${toColorHex(g)}${toColorHex(b)}`;
    const parsedColor = parseColor(hex);
    if(parsedColor.keyword != null) {
      return parsedColor.keyword;
    } else {
      return hex;
    }
  }
}
1171493
def toConsole(self):
        '''
        
        '''
        fmt_spec = {
            "class":     utils.AnsiColors.BOLD_MAGENTA,
            "struct":    utils.AnsiColors.BOLD_CYAN,
            "define":    utils.AnsiColors.BOLD_YELLOW,
            "enum":      utils.AnsiColors.BOLD_MAGENTA,
            "enumvalue": utils.AnsiColors.BOLD_RED,     # red means unused in framework
            "function":  utils.AnsiColors.BOLD_CYAN,
            "file":      utils.AnsiColors.BOLD_YELLOW,
            "dir":       utils.AnsiColors.BOLD_MAGENTA,
            "group":     utils.AnsiColors.BOLD_RED,     # red means unused in framework
            "namespace": utils.AnsiColors.BOLD_CYAN,
            "typedef":   utils.AnsiColors.BOLD_YELLOW,
            "union":     utils.AnsiColors.BOLD_MAGENTA,
            "variable":  utils.AnsiColors.BOLD_CYAN
        }

        self.consoleFormat(
            "{0} and {1}".format(
                utils._use_color("Classes", fmt_spec["class"],  sys.stderr),
                utils._use_color("Structs", fmt_spec["struct"], sys.stderr),
            ),
            self.class_like,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Defines", fmt_spec["define"], sys.stderr),
            self.defines,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Enums", fmt_spec["enum"], sys.stderr),
            self.enums,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Enum Values (unused)", fmt_spec["enumvalue"], sys.stderr),
            self.enum_values,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Functions", fmt_spec["function"], sys.stderr),
            self.functions,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Files", fmt_spec["file"], sys.stderr),
            self.files,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Directories", fmt_spec["dir"], sys.stderr),
            self.dirs,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Groups (unused)", fmt_spec["group"], sys.stderr),
            self.groups,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Namespaces", fmt_spec["namespace"], sys.stderr),
            self.namespaces,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Typedefs", fmt_spec["typedef"], sys.stderr),
            self.typedefs,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Unions", fmt_spec["union"], sys.stderr),
            self.unions,
            fmt_spec
        )
        self.consoleFormat(
            utils._use_color("Variables", fmt_spec["variable"], sys.stderr),
            self.variables,
            fmt_spec
        )
1243376
function getColorStr(color) {
    var hex = color.hexString();
    var alpha = getAlphaHex(color.alpha());
    var colorStr = '#' + alpha + hex.slice(1);

    return colorStr.toLowerCase();
}
244761
function enum_ (options) {
  options.hash.kind = 'member'
  options.hash.isEnum = true
  var result = _identifier(options)
  return result ? options.fn(result) : 'ERROR, Cannot find enum.'
}
1149038
def have_enum_value(enum, value, headers = nil, &b)
      checking_for "#{enum}.#{value}" do
        if try_compile(<<"SRC", &b)
#{COMMON_HEADERS}
        #{cpp_include(headers)}
/*top*/
int main() { #{enum} t = #{value}; t = t; return 0; }
SRC
          $defs.push(format('-DHAVE_ENUM_%s', value.upcase))
          true
        else
          false
        end
      end
    end
692255
function decodeColor( /*! The mixed color mode */ $col )
    {
        $decode = null;
        if ( is_array( $col ) )
            $decode = $col;
        else if ( is_string( $col ) )
        {
            if ( preg_match( "/^#([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})/", $col, $regs ) )
                $decode = array( hexdec( $regs[1] ), hexdec( $regs[2] ), hexdec( $regs[3] ) );
        }
        return $decode;
    }
699630
function parseColor(val) {
    if (_cache[val])
      return _cache[val];

    var result = [0, 0, 0];

    if (val.match(/^#/)) {
      val = (val || '').replace(/^#/, '');
      result = (val.length === 3) ?
        [
          parseInt(val.charAt(0) + val.charAt(0), 16),
          parseInt(val.charAt(1) + val.charAt(1), 16),
          parseInt(val.charAt(2) + val.charAt(2), 16)
        ] :
        [
          parseInt(val.charAt(0) + val.charAt(1), 16),
          parseInt(val.charAt(2) + val.charAt(3), 16),
          parseInt(val.charAt(4) + val.charAt(5), 16)
        ];
    } else if (val.match(/^ *rgba? *\(/)) {
      val = val.match(
        /^ *rgba? *\( *([0-9]*) *, *([0-9]*) *, *([0-9]*) *(,.*)?\) *$/
      );
      result = [
        +val[1],
        +val[2],
        +val[3]
      ];
    }

    _cache[val] = {
      r: result[0],
      g: result[1],
      b: result[2]
    };

    return _cache[val];
  }
185224
function formatBufferUncolored(err, options) {
    // istanbul ignore else
    if (!hex) {
        return err.buffer.toString('hex');
    }

    options = options || {};

    var hasOffset = !(err.offset === undefined || err.offset === null);
    var hasEnd = !(err.endOffset === undefined || err.endOffset === null);
    var markStart = options.markStart || '>';
    var markEnd = options.markEnd || '<';
    var accum = 0;

    var opts = options.hexerOptions ? Object.create(options.hexerOptions) : {};
    if (hasOffset) {
        opts.groupSeparator = '';
        if (hasEnd) {
            opts.decorateHexen = decorateRangedError;
        } else {
            opts.decorateHexen = decorateError;
        }
    }
    return hex(err.buffer, opts);

    // TODO: suspected broken across lines, should either test and complete or
    // use some sort of alternate notation such as interstitial lines
    function decorateRangedError(totalOffset, screenOffset, hexen) {
        var s;
        if (totalOffset === err.offset) {
            accum = 1;
            s = markStart + hexen;
            if (totalOffset === err.endOffset-1) {
                s += markEnd;
                accum = 0;
            } else {
                s = ' ' + s;
            }
            return s;
        } else if (totalOffset === err.endOffset-1) {
            s = hexen + markEnd;
            while (accum-- > 0) s += ' ';
            accum = 0;
            return s;
        } else if (accum) {
            accum += 2;
            return hexen;
        } else {
            return ' ' + hexen + ' ';
        }
    }

    function decorateError(totalOffset, screenOffset, hexen) {
        if (totalOffset === err.offset) {
            return markStart + hexen + markEnd;
        } else {
            return ' ' + hexen + ' ';
        }
    }
}
899938
function Enum(keys) {
  if (!(keys instanceof Array)) {
    throw new Error('Expected keys to be an array!');
  }

  const map = {};
  keys.forEach(key => {
    map[key] = key;
  });

  // ------------------------------------------------
  // Install an iterator that iterates over the
  // enum keys

  map[Symbol.iterator] = function() {
    let nextIndex = 0;

    const members = Object.values(map);

    return {
      next: function() {
        return nextIndex < keys.length ? {value: members[nextIndex++], done: false} : {done: true};
      },
    };
  };

  function testProperty(map, property) {
    if (!map[property]) {
      throw new Error(`Member '${property}' not found on the Enum.`);
    }
    return map[property];
  }

  const functions = {
    // ------------------------------------------------
    // Return an array of enums
    toArray: function() {
      return Object.values(map);
    },

    // ------------------------------------------------
    // Check if an enum key is valid
    isValid: function(key) {
      return map.hasOwnProperty(key);
    },

    // ------------------------------------------------
    // Enum to string
    toString: function() {
      return 'Enum{' + functions.toArray().join(', ') + '}';
    },
  };

  // ------------------------------------------------
  // Restrict reads and writes of properties to this
  // Enum object
  return new Proxy(map, {
    get: (target, property) => {
      if (functions[property]) {
        return functions[property];
      }
      return testProperty(map, property);
    },
    set: (target, property, value) => {
      throw new Error('Enum members may not be added.');
    },
  });
}