Utility methods for creating and converting colors in various color spaces and formats, including HSI (Hue, Saturation, Intensity) and RGBA (Red, Green, Blue, Alpha), and for lightening or darkening colors.
Attributes
- See also
- Companion
- class
- Source
- Color.scala
- Graph
-
- Supertypes
- Self type
-
Color.type
Members list
Type members
Inherited and Abstract types
The names of the product elements.
The name of the type.
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 255.
- red
-
The red component, in the range [0, 255].
Attributes
- Source
- Color.scala
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 255.
- saturation
-
The saturation component of the color, in the range [0, 1].
Attributes
- Source
- Color.scala
Attributes
- Source
- Color.scala
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
- Source
- Color.scala
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, 0.
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, 0.
Attributes
- Source
- Color.scala
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
- Source
- Color.scala
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). A gray has no hue of its own, so its hue is reported as smile.colors.Color.GrayHSIHue and its saturation as zero. smile.colors.Color.fromHSI and smile.colors.Color.hsiToRGB accept every returned triple and ignore the hue when saturation is zero.
- Source
- Color.scala
Attributes
- Source
- Color.scala
Concrete fields
The hue smile.colors.Color.rgbToHSI reports for a gray, which has no hue of its own. It is zero, the start of the color circle. smile.colors.Color.fromHSI and smile.colors.Color.hsiToRGB reject a NaN hue.
The hue smile.colors.Color.rgbToHSI reports for a gray, which has no hue of its own. It is zero, the start of the color circle. smile.colors.Color.fromHSI and smile.colors.Color.hsiToRGB reject a NaN hue.
Attributes
- Source
- Color.scala
Givens
Givens
Attributes
- Source
- Color.scala
