Package-level declarations

Types

Link copied to clipboard

Represents the threshold values for contrast ratio compliance.

Properties

Link copied to clipboard

Retrieves the Color that was used to generate this DynamicScheme.

Functions

Link copied to clipboard

Applies tonal elevation to a background color based on the current ColorScheme and elevation.

Link copied to clipboard
fun Color.blend(to: Color, amount: Float = 0.5f): Color

Blends this Color into another color, adjusting hue, chroma, and tone based on the specified amount.

fun Blend.blend(from: Color, to: Color, amount: Float): Color

Blends two colors together, adjusting hue, chroma, and tone based on the specified amount.

Link copied to clipboard
fun Color.blendHue(to: Color, amount: Float = 0.5f): Color

Blends the hue of this Color into another color while maintaining the original chroma and tone.

fun Blend.blendHue(from: Color, to: Color, amount: Float): Color

Blends the hue of one color into another while maintaining the original chroma and tone.

Link copied to clipboard

Calculates the contrast ratio between two colors.

Link copied to clipboard

Computes the cool-warm factor of a color.

Link copied to clipboard

Computes the contrast ratio of the tonal values between two colors.

Link copied to clipboard

Generates a set of content key tones from the specified color.

Link copied to clipboard
fun Color.darken(ratio: Float = 1.1f): Color

Darkens the color by the specified ratio.

Link copied to clipboard

Lightens the color if it is disliked to make it more likable.

Link copied to clipboard

Converts a Color from Compose to its HCT (Hue, Chroma, Tone) representation.

Generates a set of key tones from the specified color.

Creates a TonalPalette based on the provided Color.

Creates a TonalPalette based on the provided Hct color representation.

Creates a TonalPalette based on the provided ARGB color integer.

Link copied to clipboard

Retrieves the Color that corresponds to this DynamicColor based on the provided DynamicScheme.

Link copied to clipboard
fun Color.harmonize(other: Color, matchSaturation: Boolean = false): Color

Blends the hue of this Color towards the hue of the specified other color, while keeping the original color recognizable and shifted towards the target color.

fun Blend.harmonize(fromColor: Color, toColor: Color, matchSaturation: Boolean = false): Color

Blends the hue of the fromColor towards the hue of the toColor, while keeping the original color recognizable and shifted towards the target color.

Link copied to clipboard
fun ColorScheme.harmonizeWithPrimary(color: Color, matchSaturation: Boolean = false): Color

Returns the Color that represents the given color harmonized with the primary color of this ColorScheme.

Link copied to clipboard
fun Color.hasSufficientContrast(other: Color, threshold: ContrastThreshold = ContrastThreshold.WCAG_AA_NORMAL_TEXT): Boolean

Determines if the contrast ratio between two colors meets or exceeds a specified threshold.

Link copied to clipboard

Checks if the color is considered cool based on its cool-warm factor.

Link copied to clipboard

Determines if the color is disliked.

Link copied to clipboard

Checks if the Color is considered light.

Link copied to clipboard

Checks if the color is considered warm based on its cool-warm factor.

Link copied to clipboard
fun Color.lighten(ratio: Float = 1.0f): Color

Lightens the color by the specified ratio.

Link copied to clipboard

Generates a set of key tones from the specified color.

Link copied to clipboard
fun QuantizerCelebi.quantize(image: ImageBitmap, maxColors: Int): Map<Int, Int>

Quantizes the colors in an ImageBitmap to a specified maximum number of colors.

Link copied to clipboard
fun rememberThemeColor(image: ImageBitmap, fallbackColor: Color = MaterialTheme.colorScheme.primary, filter: Boolean = true, maxColors: Int = MAX_COLORS_DEFAULT): Color

Creates a state holder for the most suitable theme color derived from an ImageBitmap.

Link copied to clipboard
fun rememberThemeColors(image: ImageBitmap, fallbackColor: Color = MaterialTheme.colorScheme.primary, maxColors: Int = MAX_COLORS_DEFAULT, filter: Boolean = true, numberOfColors: Int = DESIRED_COLORS_DEFAULT): List<Color>

Creates a state holder for a list of theme colors derived from an ImageBitmap.

Link copied to clipboard

Computes the surface color at a given elevation using the current MaterialTheme's color scheme.

Link copied to clipboard

Creates a TemperatureCache for a color using color temperature theory.

Link copied to clipboard
fun ImageBitmap.themeColor(fallbackColor: Color = Color(-0xbd7a0c), filter: Boolean = true, maxColors: Int = MAX_COLORS_DEFAULT): Color

Determines the most suitable color in an ImageBitmap for a UI theme.

Link copied to clipboard
fun ImageBitmap.themeColorOrNull(filter: Boolean = true, maxColors: Int = MAX_COLORS_DEFAULT): Color?

Determines the most suitable color in an ImageBitmap for a UI theme, or null if no suitable color is found.

Link copied to clipboard
fun ImageBitmap.themeColors(maxColors: Int = MAX_COLORS_DEFAULT, fallbackColor: Color = Color(-0xbd7a0c), filter: Boolean = true, numberOfColors: Int = DESIRED_COLORS_DEFAULT): List<Color>

Ranks colors extracted from an ImageBitmap by their suitability for a UI theme.

Link copied to clipboard

Converts an Hct value to a Compose Color.

Link copied to clipboard

Converts a list of Hct values to a list of Compose Color values.

Link copied to clipboard
fun Color.toDynamicScheme(isDark: Boolean, style: PaletteStyle, contrast: Contrast = Contrast.Default): DynamicScheme

Generates a DynamicScheme based on the specified Color and configuration parameters.

Link copied to clipboard
fun Color.toHct(): Hct

Converts a Compose Color to its HCT (Hue, Chroma, Tone) representation.

Link copied to clipboard

Converts a list of Compose Color values to a list of HCT (Hue, Chroma, Tone) values.