ColorRGBa

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

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

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

See also

Constructors

Link copied to clipboard
constructor(r: Double, g: Double, b: Double, alpha: Double = 1.0, linearity: Linearity = Linearity.LINEAR)

Types

Link copied to clipboard
object Companion
Link copied to clipboard

Properties

Link copied to clipboard
open override val alpha: Double = 1.0
Link copied to clipboard
Link copied to clipboard
val b: Double
Link copied to clipboard
val g: Double
Link copied to clipboard
Link copied to clipboard

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

Link copied to clipboard

The maximum value over r, g, b

Link copied to clipboard

The minimum value over r, g, b

Link copied to clipboard
val r: Double

Functions

Link copied to clipboard

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

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

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
Link copied to clipboard
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
Link copied to clipboard
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

Convert to SRGB

Link copied to clipboard
open override fun toVector4(): Vector4
Link copied to clipboard
Link copied to clipboard
Link copied to clipboard