ChromaColor

interface ChromaColor<T>(source)

Represents a color that contains chroma information, provides utility methods for manipulating chroma values, and can produce a new instance of the implementing type with adjusted chroma values.

Parameters

T

The type that implements the interface, typically representing a color model.

Inheritors

Properties

Link copied to clipboard
abstract val chroma: Double

Represents the chromatic intensity of a color. Chroma is a measure of the color's vividness or strength, typically ranging from neutral gray tones (low chroma) to highly saturated, vivid colors (high chroma). This property can be manipulated to adjust the visual characteristics of the color.

Functions

Link copied to clipboard
open fun mixChroma(target: Double, factor: Double): T
Link copied to clipboard
open fun modulateChroma(factor: Double): T

Adjusts the chroma of the color by scaling it with the specified factor and returns a new instance with the updated chroma value. This method allows for proportionally increasing or decreasing the chromatic intensity of the color.

Link copied to clipboard
open fun shiftChroma(shift: Double): T

Adjusts the chroma of the color by the specified shift value and returns a new instance with the updated chroma. The resulting chroma is calculated by adding the provided shift value to the current chroma.

Link copied to clipboard
abstract fun withChroma(chroma: Double): T

Creates a new instance of the implementing type with the specified chroma value.