ColorRGBa

data class ColorRGBa @JvmOverloads constructor(    val r: Double,     val g: Double,     val b: Double,     val alpha: Double = 1.0,     val linearity: Linearity = Linearity.UNKNOWN) : ColorModel<ColorRGBa> , ShadableColor<ColorRGBa> , AlgebraicColor<ColorRGBa>

A generic RGB color space capable of representing both the linear and the sRGB color spaces.

See also

Parameters

r

red as a percentage between 0.0 and 1.0

g

green as a percentage between 0.0 and 1.0

b

blue as a percentage between 0.0 and 1.0

alpha

alpha as a percentage between 0.0 and 1.0

Constructors

Link copied to clipboard
fun ColorRGBa(    r: Double,     g: Double,     b: Double,     alpha: Double = 1.0,     linearity: Linearity = Linearity.UNKNOWN)

Types

Link copied to clipboard
object Companion
Link copied to clipboard
enum Component : Enum<ColorRGBa.Component>

Functions

Link copied to clipboard
open operator override fun div(scale: Double): ColorRGBa
Link copied to clipboard
fun getContrastRatio(other: ColorRGBa): Double

calculate the contrast value between this color and the given color contrast value is accordingo to // see http://www.w3.org/TR/2008/REC-WCAG20-20081211/#contrast-ratiodef

Link copied to clipboard
open override fun hashCode(): Int
Link copied to clipboard
open operator override fun minus(right: ColorRGBa): ColorRGBa
Link copied to clipboard
open override fun mix(other: ColorRGBa, factor: Double): ColorRGBa
Link copied to clipboard
open override fun opacify(factor: Double): ColorRGBa

Creates a copy of color with adjusted opacity

Link copied to clipboard
open operator override fun plus(right: ColorRGBa): ColorRGBa
Link copied to clipboard
open override fun shade(factor: Double): ColorRGBa

Creates a copy of color with adjusted color

Link copied to clipboard
open operator override fun times(scale: Double): ColorRGBa
Link copied to clipboard
fun toHSLa(): ColorHSLa
Link copied to clipboard
fun toHSVa(): ColorHSVa
Link copied to clipboard
fun toLABa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLABa
Link copied to clipboard
fun toLCHABa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLCHABa
Link copied to clipboard
fun toLCHUVa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLCHUVa
Link copied to clipboard
fun toLinear(): ColorRGBa
Link copied to clipboard
fun toLUVa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLUVa
Link copied to clipboard
open override fun toRGBa(): ColorRGBa

Convert into ColorRGBa.

Link copied to clipboard
fun toSRGB(): ColorRGBa

Convert to SRGB

Link copied to clipboard
open override fun toVector4(): Vector4
Link copied to clipboard
fun toXSLa(): ColorXSLa
Link copied to clipboard
fun toXSVa(): ColorXSVa
Link copied to clipboard
fun toXYZa(): ColorXYZa

Properties

Link copied to clipboard
open override val alpha: Double = 1.0
Link copied to clipboard
val alphaMultiplied: ColorRGBa
Link copied to clipboard
val b: Double
Link copied to clipboard
val g: Double
Link copied to clipboard
val linearity: Linearity
Link copied to clipboard
val luminance: Double

calculate luminance value luminance value is according to https://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef

Link copied to clipboard
val maxValue: Double

The maximum value over r, g, b

Link copied to clipboard
val minValue: Double

The minimum value over r, g, b

Link copied to clipboard
val r: Double
Link copied to clipboard
val saturated: ColorRGBa

Copy of the the color with all of its fields clamped to [0, 1]

Sources

Link copied to clipboard