Top
You are looking at an outdated 7.5.1 version of this document. Switch to the 7.14.3 version to see the up to date information.

namespace anychart.color Improve this Doc

Color utilities namespace.

Functions Overview

blend()Blend two colors together, using the specified factor to indicate the weight given to the first color.
darken()Makes color darker by a factor.
lighten()Makes color lighter by a factor.

Functions Description

blend

Blend two colors together, using the specified factor to indicate the weight given to the first color.

Params:

Name Type Description
rgb1 goog.color.Rgb The first color represented as RGB array of 3 numbers.
rgb2 goog.color.Rgb The second color represented as RGB array of 3 numbers.
factor number 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, factor will be set to 0. If greater than 1, factor will be set to 1.

Returns:

goog.color.Rgb - Combined color represented as RGB array.

Try it:

darken

Makes color darker by a factor.

Params:

Name Type Default Description
fillOrStroke anychart.graphics.vector.Fill | anychart.graphics.vector.Stroke
Fill or stroke to be darkened.
factor number
0.3
Black color blending factor.

Returns:

string anychart.graphics.vector.Fill anychart.graphics.vector.Stroke - Hex representation of the darkened color, or Color if color can't be darkened.

Try it:

lighten

Makes color lighter by a factor.

Params:

Name Type Default Description
fillOrStroke anychart.graphics.vector.Fill | anychart.graphics.vector.Stroke
Fill or stroke to be lightened.
factor number
0.3
White color blending factor.

Returns:

string anychart.graphics.vector.Fill anychart.graphics.vector.Stroke - Hex representation of the lightened color, or Color if color can not be lighten.

Try it: