@tempots/color
SRGB class
Represents a color in the sRGB color space.
Signature:
declare class SRGB
Constructors
Constructor |
Modifiers |
Description |
---|---|---|
Constructs a new instance of the |
Properties
Property |
Modifiers |
Type |
Description |
---|---|---|---|
|
number |
The blue component of the sRGB color. | |
|
(other: SRGB, tollerance?: number) => boolean |
Checks if the current SRGB instance is equal to another SRGB instance. | |
|
(s: string) => SRGB |
Creates an SRGB color instance from a string representation of an RGB color. The string should be in the format "rgb(r%, g%, b%)" where r, g, and b are the red, green, and blue color values respectively. | |
|
number |
The green component of the sRGB color. | |
|
([red, blue, green]: [red: number, blue: number, green: number]) => SRGB |
Creates an SRGB color instance from the given channel values. | |
|
number |
The red component of the sRGB color. | |
|
() => [number, number, number] |
Converts the SRGB color to an array of normalized channel values. Each channel value is divided by 100 to obtain a value between 0 and 1. | |
|
() => string |
Returns a string representation of the RGB color in the format "rgb(red%, blue%, green%)". | |
|
(blue: number) => SRGB |
Returns a new SRGB instance with the specified blue value. | |
|
(green: number) => SRGB |
Returns a new SRGB color with the specified green value. | |
|
(red: number) => SRGB |
Returns a new SRGB color with the specified red value. |