Color

smile.colors.Color
See theColor companion object
case class Color(red: Int, green: Int, blue: Int, opacity: Int) extends Paint

Represents a color with RGB and opacity components. Optionally, a canonical name can be associated.

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].

opacity

The opacity of the color, in the range [0, 255]. Defaults to smile.infrastructure.Constants.MaximumOpacity.

red

The red component of the color, in the range [0, 255].

Attributes

Companion
object
Graph
Supertypes
trait Serializable
trait Product
trait Equals
trait Paint
class Object
trait Matchable
class Any
Show all
Known subtypes
class PresetColor

Members list

Value members

Constructors

def this(argb: Int)

Concrete 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
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.

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
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.

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.

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.

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.

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.

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.

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.

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
Any

Inherited methods

def productElementNames: Iterator[String]

Attributes

Inherited from:
Product
def productIterator: Iterator[Any]

Attributes

Inherited from:
Product

Concrete fields

lazy override val averageColor: Color

Attributes

Returns

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