Color
Hierarchy
- Color
Constructors
constructor
- new
Color(r: number, g: number, b: number, a?: number): Color -
Creates a new Sass color with the given red, green, blue, and alpha channels. The red, green, and blue channels must be integers between 0 and 255 (inclusive), and alpha must be between 0 and 1 (inclusive).
Example
new sass.types.Color(107, 113, 127); // #6b717f
new sass.types.Color(0, 0, 0, 0); // rgba(0, 0, 0, 0)Parameters
-
r: number
-
g: number
-
b: number
-
Optional
a: number
Returns Color
-
constructor
- new
Color(argb: number): Color -
Creates a new Sass color with alpha, red, green, and blue channels taken from respective two-byte chunks of a hexidecimal number.
Example
new sass.types.Color(0xff6b717f); // #6b717f
new sass.types.Color(0x00000000); // rgba(0, 0, 0, 0)Parameters
-
argb: number
Returns Color
-
Methods
getA
getB
getG
getR
setA
- setA(value: number): void
-
Sets the alpha channel of the color. The value must be between 0 and 1 (inclusive).
Deprecated
Use constructor instead.
Parameters
-
value: number
Returns void
-
setB
- setB(value: number): void
-
Sets the blue channel of the color. The value must be an integer between 0 and 255 (inclusive).
Deprecated
Use constructor instead.
Parameters
-
value: number
Returns void
-
setG
- setG(value: number): void
-
Sets the green channel of the color. The value must be an integer between 0 and 255 (inclusive).
Deprecated
Use constructor instead.
Parameters
-
value: number
Returns void
-
setR
- setR(value: number): void
-
Sets the red channel of the color. The value must be an integer between 0 and 255 (inclusive).
Deprecated
Use constructor instead.
Parameters
-
value: number
Returns void
-
Sass's color type.