PresetColor

smile.colors.PresetColor
See thePresetColor companion object
class PresetColor(argbInt: Int, val canonicalName: String) extends Color

Represents a predefined color with a canonical name, extending the Color class.

Value parameters

argbInt

The ARGB integer representing the color.

canonicalName

The canonical name for the color.

Attributes

Constructor

Creates a PresetColor from an ARGB integer and a canonical name.

Companion
object
Graph
Supertypes
class Color
trait Serializable
trait Product
trait Equals
trait Paint
class Object
trait Matchable
class Any
Show all

Members list

Value members

Constructors

def this(color: Color, canonicalName: String)

Auxiliary constructor for creating a PresetColor from an existing Color instance and a canonical name. This constructor facilitates the easy labeling of colors with descriptive names.

Auxiliary constructor for creating a PresetColor from an existing Color instance and a canonical name. This constructor facilitates the easy labeling of colors with descriptive names.

Value parameters

canonicalName

The canonical name for the color.

color

The Color instance to be associated with a canonical name.

Attributes

Inherited methods

def darker: Color

Darkens the color by a default factor.

Darkens the color by a default factor.

Attributes

Returns

A new Color instance that is a darker version of this color.

See also
Inherited from:
Color
def isOpaque: Boolean

Checks if the color is fully opaque.

Checks if the color is fully opaque.

Attributes

Returns

true if the opacity is equal to smile.infrastructure.Constants.MaximumOpacity, otherwise false.

Inherited from:
Color
def lighter: Color

Lightens the color by a default factor.

Lightens the color by a default factor.

Attributes

Returns

A new Color instance that is a lighter version of this color.

See also
Inherited from:
Color
def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product
def shadeByFactor(shadingFactorFromZeroToOne: Double): Color

Darkens the color by a specified factor.

Darkens the color by a specified factor.

Value parameters

shadingFactorFromZeroToOne

The factor to darken the color by, in the range [0, 1].

Attributes

Returns

A new Color instance that is a darker version of this color by the specified factor.

Inherited from:
Color
def shadeByPercentage(shadingFactorInPercents: Double): Color

Darkens the color by a specified percentage.

Darkens the color by a specified percentage.

Value parameters

shadingFactorInPercents

The percentage to darken the color by, in the range [0, 100].

Attributes

Returns

A new Color instance that is a darker version of this color by the specified percentage.

Inherited from:
Color
def tintByFactor(tintingFactorFromZeroToOne: Double): Color

Lightens the color by a specified factor.

Lightens the color by a specified factor.

Value parameters

tintingFactorFromZeroToOne

The factor to lighten the color by, in the range [0, 1].

Attributes

Returns

A new Color instance that is a lighter version of this color by the specified factor.

Inherited from:
Color
def tintByPercentage(tintingFactorInPercents: Double): Color

Lightens the color by a specified percentage.

Lightens the color by a specified percentage.

Value parameters

tintingFactorInPercents

The percentage to lighten the color by, in the range [0, 100].

Attributes

Returns

A new Color instance that is a lighter version of this color by the specified percentage.

Inherited from:
Color
def toARGBInt: Int

Converts the color to an ARGB integer.

Converts the color to an ARGB integer.

Attributes

Returns

An integer representing the ARGB value of the color.

Inherited from:
Color
def toHSI: (Double, Double, Double)

Converts the color to HSI (Hue, Saturation, Intensity) format.

Converts the color to HSI (Hue, Saturation, Intensity) format.

Attributes

Returns

A tuple containing the HSI components of the color.

Inherited from:
Color
def toRGBAInt: Int

Converts the color to an RGBA integer.

Converts the color to an RGBA integer.

Attributes

Returns

An integer representing the RGBA value of the color.

Inherited from:
Color
override def toString: String

Returns a string representation of the object.

Returns a string representation of the object.

The default representation is platform dependent.

Attributes

Returns

a string representation of the object.

Definition Classes
Color -> Any
Inherited from:
Color

Concrete fields

val canonicalName: String

Inherited fields

lazy override val averageColor: Color

Attributes

Returns

A Color object representing the average color of the paint pattern.

Inherited from:
Color