/** * Color utility namespace. * @namespace * @name anychart.color */ anychart.color;
/** * Blend two colors together, using the specified factor to indicate the weight given to the first color. * @example anychart.color.blend * @param {Array<number>} rgb1 The first color represented as RGB array of 3 numbers. * @param {Array<number>} rgb2 The second color represented as RGB array of 3 numbers. * @param {number} factor The weight of the first color over the second one rgb2. Values * should be in the [0, 1] range. If set to a value less than 0, the factor will be set to 0. * If greater than 1, the factor will be set to 1. * @return {anychart.graphics.vector.SolidFill} Combined color represented as {@link anychart.graphics.vector.SolidFill}. */ anychart.color.blend;
/** * Makes color lighter by a factor. * @example anychart.color.lighten * @param {(anychart.graphics.vector.Fill|anychart.graphics.vector.Stroke)} fillOrStroke Fill or stroke to be lightened. * @param {number=} opt_factor [0.3] White color blending factor. * @return {(string|anychart.graphics.vector.Fill|anychart.graphics.vector.Stroke)} Hex representation of the lightened color, or Color if color cannot be lightened. */ anychart.color.lighten;
/** * Makes color darker by a factor. * @example anychart.color.darken * @param {(anychart.graphics.vector.Fill|anychart.graphics.vector.Stroke)} fillOrStroke Fill or stroke to be darkened. * @param {number=} opt_factor [0.3] Black color blending factor. * @return {(string|anychart.graphics.vector.Fill|anychart.graphics.vector.Stroke)} Hex representation of the darkened color, or Color if color can’t be darkened. */ anychart.color.darken;
/** * @ignoreDoc will be reworked * Sets opacity to stroke or fill. * @param {(anychart.graphics.vector.Stroke|anychart.graphics.vector.Fill)} strokeOrFill Stroke or fill. * @param {number} value Opacity to set (from 0 to 1). * @param {boolean=} opt_isFill Is it fill or not. If emit the param - it would be stroke. * @return {(anychart.graphics.vector.Stroke|anychart.graphics.vector.Fill)} Normalized color with new opacity. * @since 7.6.0 */ anychart.color.setOpacity;
/** * Sets opacity to stroke. * @example anychart.color.setThickness * @param {anychart.graphics.vector.Stroke} stroke Stroke. * @param {number} thickness Thickness to set. * @param {number=} opt_opacity Opacity to set. * @return {anychart.graphics.vector.Stroke} Normalized color with new thickness. * @since 7.6.0 */ anychart.color.setThickness;
/** * Single-hue progression. * @detailed Single-hue progressions fade from a dark shade of the chosen color to a very light or white shade of relatively * the same hue. * @example anychart.color.singleHueProgression * @param {string=} opt_color ['black'] Color in rgb, named or hex string representation like 'rgb(255, 0, 0)', 'red' or * '#ff0000' accordingly. * @param {number=} opt_count [7] Count of progression colors. * @param {number=} opt_startOrTargetLightness [0.95] Source lightness. Number in [0, 1]. 1 - very light (white), * 0 - vere dark (black). If opt_startOrTargetLightness and opt_endLightness don’t defined, then lightness progression * starts from 0.95 and ends to lightness of passed color. * @param {number=} opt_endLightness [from passed color] Target lightness. Number in [0, 1]. 1 - very light (white), 0 - vere dark (black). * @return {Array.<string>} Single hue progression. Array of colors. */ anychart.color.singleHueProgression;
/** * Multiple bipolar hue progression. * @detailed For bipolar data, we recommend color schemes in which two hues diverge away from a common light/white hue. * @example anychart.color.bipolarHueProgression * @param {string=} opt_color1 ['blue'] Color in rgb, named or hex string representation like 'rgb(255, 0, 0)', 'red' or * '#ff0000' accordingly. * @param {string=} opt_color2 ['red'] Color in rgb, named or hex string representation like 'rgb(255, 0, 0)', 'red' or * '#ff0000' accordingly. * @param {number=} opt_count [7] Count of progression colors. * @return {Array.<string>} Multiple bipolar hue progression. Array of colors. */ anychart.color.bipolarHueProgression;
/** * Multiple blended hue progression. * @detailed Blended hue progressions uses related hues to blend together the two end point hues. * @example anychart.color.blendedHueProgression * @param {?string=} opt_color1 ['#ffff00'] Color in rgb, named or hex string representation like 'rgb(255, 0, 0)', 'red' or * '#ff0000' accordingly. * @param {?string=} opt_color2 ['#a52a2a'] Color in rgb, named or hex string representation like 'rgb(255, 0, 0)', 'red' or * '#ff0000' accordingly. * @param {number=} opt_count [7] Count of progression colors. * @return {Array.<string>} Multiple blended hue progression. Array of colors. */ anychart.color.blendedHueProgression;