<commit_before>// We can't use goog.color or goog.color.alpha because they interally use a hex
// string representation that encodes each channel in a single byte.  This
// causes occasional loss of precision and rounding errors, especially in the
// alpha channel.

goog.provide('ol.color');

goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.color');
goog.require('goog.color.names');
goog.require('goog.math');
goog.require('goog.vec.Mat4');


/**
 * @define {boolean} Enable named colors.
 * Enabling named colors adds about 3KB uncompressed / 1.5KB compressed to the
 * final build size.
 */
ol.color.ENABLE_NAMED_COLORS = true;


/**
 * A color represented as a short array [red, green, blue, alpha].
 * red, green, and blue should be integers in the range 0..255 inclusive.
 * alpha should be a float in the range 0..1 inclusive.
 * @typedef {Array.<number>}
 */
ol.Color;


/**
 * @type {RegExp}
 * @private
 * This RegExp matches # followed by 3 or 6 hex digits.
 */
ol.color.hexColorRe_ = /^#(?:[0-9a-f]{3}){1,2}$/i;


/**
 * @type {RegExp}
 * @private
 * This RegExp matches # followed by 4 or 8 hex digits.
 */
ol.color.hexaColorRe_ = /^#(?:[0-9a-f]{4}){1,2}$/i;


/**
 * @type {RegExp}
 * @private
 * @see goog.color.rgbColorRe_
 */
ol.color.rgbColorRe_ =
    /^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;


/**
 * @type {RegExp}
 * @private
 * @see goog.color.alpha.rgbaColorRe_
 */
ol.color.rgbaColorRe_ =
    /^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i;


/**
 * @param {ol.Color} dst Destination.
 * @param {ol.Color} src Source.
 * @param {ol.Color=} opt_color Color.
 * @return {ol.Color} Color.
 */<commit_msg>Remove unused RegExp, thanks @fredj<commit_after>// We can't use goog.color or goog.color.alpha because they interally use a hex
// string representation that encodes each channel in a single byte.  This
// causes occasional loss of precision and rounding errors, especially in the
// alpha channel.

goog.provide('ol.color');

goog.require('goog.array');
goog.require('goog.asserts');
goog.require('goog.color');
goog.require('goog.color.names');
goog.require('goog.math');
goog.require('goog.vec.Mat4');


/**
 * @define {boolean} Enable named colors.
 * Enabling named colors adds about 3KB uncompressed / 1.5KB compressed to the
 * final build size.
 */
ol.color.ENABLE_NAMED_COLORS = true;


/**
 * A color represented as a short array [red, green, blue, alpha].
 * red, green, and blue should be integers in the range 0..255 inclusive.
 * alpha should be a float in the range 0..1 inclusive.
 * @typedef {Array.<number>}
 */
ol.Color;


/**
 * @type {RegExp}
 * @private
 * This RegExp matches # followed by 3 or 6 hex digits.
 */
ol.color.hexColorRe_ = /^#(?:[0-9a-f]{3}){1,2}$/i;


/**
 * @type {RegExp}
 * @private
 * @see goog.color.rgbColorRe_
 */
ol.color.rgbColorRe_ =
    /^(?:rgb)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2})\)$/i;


/**
 * @type {RegExp}
 * @private
 * @see goog.color.alpha.rgbaColorRe_
 */
ol.color.rgbaColorRe_ =
    /^(?:rgba)?\((0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|[1-9]\d{0,2}),\s?(0|1|0\.\d{0,10})\)$/i;


/**
 * @param {ol.Color} dst Destination.
 * @param {ol.Color} src Source.
 * @param {ol.Color=} opt_color Color.
 * @return {ol.Color} Color.
 */
{'fraction_non_alphanumeric': 0.21134328358208956, 'fraction_numerical': 0.03373134328358209, 'mean_word_length': 3.615702479338843, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '6680189', 'n_tokens_mistral': 1354, 'n_tokens_neox': 1269, 'n_words': 309}