Color.applyMatrix

Syntax

applyMatrix(matrix: Array);

Parameters

matrix. Color matrix.

Description

The applyMatrix method applies color matrix.

Comments

Matrix structure is presented on the color matrix description page of the World Wide Web Consortium.

Example

To execute the example, the HTML page must contain the BubbleChart component named bubbleChart (see Example of Creating the BubbleChart Component).

Determine a color matrix. Determine a color, for which the matrix is applied. Determine a solid brush, for which the matrix is applied. Set chart area background:

// Determine a color matrix
var matrix = [0, 0.2, 0, 0, 0, 0, 0.2, 0, 0, 0, 0.2, 0.2, 0.02, 0, 0, 0, 0, 0, 0.2, 0, 0, 0, 0, 0, 0.5];
// Determine a color
var color = new PP.Color(255, 0, 0);
// Apply the matrix to the color
color.applyMatrix(matrix);
// Determine a solid brush
var brush = new PP.SolidColorBrush();
// Set brush color
brush.setColor(color);
// Apply the matrix to the brush
brush.applyMatrix(matrix);
// Set chart area background
bubbleChart.getChartArea().setBackground(brush);
// Refresh chart
bubbleChart.refresh();

After executing the example chart area background color is changed:

Color