ColorBuilders.ColorProp


@RequiresSchemaVersion(major = 1, minor = 0)
public final class ColorBuilders.ColorProp


A property defining a color.

Summary

Nested types

Builder for ColorProp

Public methods

@ColorInt int

Gets the static color value, in ARGB format.

@Nullable DynamicBuilders.DynamicColor

Gets the dynamic value.

@NonNull String

Extension functions

final @NonNull ColorBuilders.ColorProp
HelpersKt.withOpacity(
    @NonNull ColorBuilders.ColorProp receiver,
    @FloatRange(from = 0.0, to = 1.0) float ratio
)

Changes the opacity/transparency of the given color.

Public methods

getArgb

Added in 1.0.0
public @ColorInt int getArgb()

Gets the static color value, in ARGB format. If a dynamic value is also set and the renderer supports dynamic values for the corresponding field, this static value will be ignored. If the static value is not specified, zero (equivalent to TRANSPARENT) will be used instead.

getDynamicValue

Added in 1.0.0
public @Nullable DynamicBuilders.DynamicColor getDynamicValue()

Gets the dynamic value. Note that when setting this value, the static value is still required to be set to support older renderers that only read the static value. If dynamicValue has an invalid result, the provided static value will be used instead.

toString

public @NonNull String toString()

Extension functions

public final @NonNull ColorBuilders.ColorProp HelpersKt.withOpacity(
    @NonNull ColorBuilders.ColorProp receiver,
    @FloatRange(from = 0.0, to = 1.0) float ratio
)

Changes the opacity/transparency of the given color.

Note that this only looks at the static value of the ColorProp, any dynamic value will be ignored.