openrndr / org.openrndr.color / ColorRGBa

ColorRGBa

data class ColorRGBa (source)

Color in RGBa space

Parameters

r - red in [0,1]

g - green in [0,1]

b - blue in [0,1]

a - alpha in [0,1]

Types

Component

enum class Component

Constructors

<init>

Color in RGBa space

ColorRGBa(r: Double, g: Double, b: Double, a: Double = 1.0, linearity: Linearity = Linearity.UNKNOWN)

Properties

a

alpha in [0,1]

val a: Double

alphaMultiplied

val alphaMultiplied: ColorRGBa

b

blue in [0,1]

val b: Double

g

green in [0,1]

val g: Double

linearity

val linearity: Linearity

maxValue

The maximum value over r, g, b

val maxValue: Double

minValue

The minimum value over r, g, b

val minValue: Double

r

red in [0,1]

val r: Double

saturated

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

val saturated: ColorRGBa

Functions

hashCode

fun hashCode(): Int

invoke

operator fun invoke(r: Double = this.r, g: Double = this.g, b: Double = this.b, a: Double = this.a): ColorRGBa

opacify

Creates a copy of color with adjusted opacity

fun opacify(opacity: Double): ColorRGBa

shade

Creates a copy of color with adjusted color

fun shade(shade: Double): ColorRGBa

toHSLa

fun toHSLa(): ColorHSLa

toHSVa

fun toHSVa(): ColorHSVa

toLABa

fun toLABa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLABa

toLCHABa

fun toLCHABa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLCHABa

toLCHUVa

fun toLCHUVa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLCHUVa

toLinear

Convert to linear RGB

fun toLinear(): ColorRGBa

toLUVa

fun toLUVa(ref: ColorXYZa = ColorXYZa.NEUTRAL): ColorLUVa

toSRGB

Convert to SRGB

fun toSRGB(): ColorRGBa

toXYZa

fun toXYZa(): ColorXYZa

Companion Object Functions

fromHex

fun fromHex(hex: Int): ColorRGBa
fun fromHex(hex: String): ColorRGBa

fromVector

Create a ColorRGBa object from a Vector3

fun fromVector(vector: Vector3, alpha: Double = 1.0): ColorRGBa

Create a ColorRGBa object from a Vector4

fun fromVector(vector: Vector4): ColorRGBa