Extends Color
A GrayColor object is used to represent any gray color value.
Creates a GrayColor object
Example — Creating a GrayColor:
The amount of gray in the color as a value between 0 and 1.
Returns the type of the color as a string.
Example
var color = new RgbColor(1, 0, 0); console.log(color.type); // 'rgb'
The color's alpha value as a number between 0 and 1. All colors of the different subclasses support alpha values.
Example — A filled path with a half transparent stroke:
The amount of red in the color as a value between 0 and 1.
Example — Changing the amount of red in a color:
The amount of green in the color as a value between 0 and 1.
Example — Changing the amount of green in a color:
The amount of blue in the color as a value between 0 and 1.
Example — Changing the amount of blue in a color:
The hue of the color as a value in degrees between 0 and 360.
Example — Changing the hue of a color:
Example — Hue cycling:
The saturation of the color as a value between 0 and 1.
The brightness of the color as a value between 0 and 1.
The lightness of the color as a value between 0 and 1.
Checks if the color has an alpha value.
Checks if the component color values of the color are the same as those of the supplied one.
Copyright © 2011 Jürg Lehni & Jonathan Puckey. All Rights Reserved.