Provides utility methods for creating and converting colors in various color spaces and formats, including HSI (Hue, Saturation, Intensity) and RGBA (Red, Green, Blue, Alpha). It also supports operations to lighten or darken colors.
Attributes
Members list
Type members
Inherited types
The names of the product elements
The names of the product elements
Attributes
- Inherited from:
- Mirror
The name of the type
The name of the type
Attributes
- Inherited from:
- Mirror
Value members
Concrete methods
Creates an ARGB integer value from RGBA components. Validates the RGBA components before conversion.
Creates an ARGB integer value from RGBA components. Validates the RGBA components before conversion.
Value parameters
- blue
-
The blue component, in the range [0, 255].
- green
-
The green component, in the range [0, 255].
- opacity
-
The opacity component, in the range [0, 255]. Default is smile.infrastructure.Constants.MaximumOpacity.
- red
-
The red component, in the range [0, 255].
Attributes
- Returns
-
An integer representing the ARGB value.
Creates a Color
instance from HSI values with optional opacity. Validates the input values for HSI and opacity before conversion.
Creates a Color
instance from HSI values with optional opacity. Validates the input values for HSI and opacity before conversion.
Value parameters
- hue
-
The hue component of the color, in degrees [0, 360).
- intensity
-
The intensity component of the color, in the range [0, 255].
- opacity
-
The opacity of the color, in the range [0, 255]. Default is smile.infrastructure.Constants.MaximumOpacity.
- saturation
-
The saturation component of the color, in the range [0, 1].
Attributes
- Returns
-
A new
Color
instance based on the specified HSI values and opacity.
Converts HSI values to RGB. Validates the input HSI values before conversion.
Converts HSI values to RGB. Validates the input HSI values before conversion.
Value parameters
- hueInDegrees
-
The hue component of the color, in degrees [0, 360).
- intensity
-
The intensity component of the color, in the range [0, 255].
- saturation
-
The saturation component of the color, in the range [0, 1].
Attributes
- Returns
-
A tuple containing the RGB components: (red, green, blue).
Determines if the specified RGB color is black. A color is considered black if its red, green, and blue components are all at their minimum value.
Determines if the specified RGB color is black. A color is considered black if its red, green, and blue components are all at their minimum value.
Value parameters
- blue
-
The blue component of the color, expected to be smile.infrastructure.Constants.MinimumBlue for black.
- green
-
The green component of the color, expected to be smile.infrastructure.Constants.MinimumGreen for black.
- red
-
The red component of the color, expected to be smile.infrastructure.Constants.MinimumRed for black.
Attributes
- Returns
-
true
if the color is black, otherwisefalse
.
Determines if the specified RGB color is a shade of gray. A color is considered gray if its red, green, and blue components are equal.
Determines if the specified RGB color is a shade of gray. A color is considered gray if its red, green, and blue components are equal.
Value parameters
- blue
-
The blue component of the color, in the range [0, 255].
- green
-
The green component of the color, in the range [0, 255].
- red
-
The red component of the color, in the range [0, 255].
Attributes
- Returns
-
true
if the color is a shade of gray, otherwisefalse
.
Converts RGB values to HSI (Hue, Saturation, Intensity). Validates the input RGB values before conversion.
Converts RGB values to HSI (Hue, Saturation, Intensity). Validates the input RGB values before conversion.
Value parameters
- blue
-
The blue component, in the range [0, 255].
- green
-
The green component, in the range [0, 255].
- red
-
The red component, in the range [0, 255].
Attributes
- Returns
-
A tuple containing the HSI components: (hue, saturation, intensity).