DynamicBuilders.DynamicColor


@RequiresSchemaVersion(major = 1, minor = 200)
public interface DynamicBuilders.DynamicColor extends DynamicBuilders.DynamicType


Interface defining a dynamic color type.

Summary

Public methods

default @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate()

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

default @NonNull DynamicBuilders.DynamicColor

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey
)

Creates a DynamicColor that is bound to the value of an item of the State.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey,
    @NonNull AnimationParameterBuilders.AnimationSpec animationSpec
)

Creates a DynamicColor that is bound to the value of an item of the State.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(@ColorInt int start, @ColorInt int end)

Creates a DynamicColor which will animate over the range of colors from start to end.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
animate(
    @ColorInt int start,
    @ColorInt int end,
    @NonNull AnimationParameterBuilders.AnimationSpec animationSpec
)

Creates a DynamicColor which will animate over the range of colors from start to end with the given animation parameters.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
constant(@ColorInt int constant)

Creates a constant-valued DynamicColor.

default static @NonNull DynamicBuilders.DynamicColor
@RequiresSchemaVersion(major = 1, minor = 200)
from(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey
)

Creates a DynamicColor that is bound to the value of an item of the State.

default static @NonNull DynamicBuilders.DynamicColor
fromByteArray(@NonNull byte[] byteArray)

Creates a DynamicColor from a byte array generated by toDynamicColorByteArray.

default static @NonNull DynamicBuilders.DynamicColor
fromByteArray(@NonNull byte[] byteArray, int offset, int length)

Creates a DynamicColor from the provided byte array at the provided offset and length, that was generated by one of the toDynamicColorByteArray overloads.

default static @NonNull ConditionScopes.ConditionScope<DynamicBuilders.DynamicColorInteger>
@RequiresSchemaVersion(major = 1, minor = 200)
onCondition(@NonNull DynamicBuilders.DynamicBool condition)

Bind the value of this DynamicColor to the result of a conditional expression.

default @NonNull byte[]

Serializes the DynamicColor into a new byte array that can later be used with fromByteArray.

default int
toDynamicColorByteArray(@NonNull byte[] byteArray)

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, that can later be used with DynamicColor.fromByteArray(byteArray, 0, bytesWritten).

default int
toDynamicColorByteArray(@NonNull byte[] byteArray, int offset, int length)

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicColor.fromByteArray(byteArray, offset, bytesWritten).

Public methods

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicColor animate()

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default @NonNull DynamicBuilders.DynamicColor animate(@NonNull AnimationParameterBuilders.AnimationSpec animationSpec)

Returns a DynamicColor that is bound to the value of this DynamicColor and every time its value is changing, it animates from its current value to the new value.

Parameters
@NonNull AnimationParameterBuilders.AnimationSpec animationSpec

The animation parameters.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor animate(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey
)

Creates a DynamicColor that is bound to the value of an item of the State. Every time the state value changes, this DynamicColor will animate from its current value to the new value (from the state).

Parameters
@NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey

The source key to a DynamicDataValue with a color value.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor animate(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey,
    @NonNull AnimationParameterBuilders.AnimationSpec animationSpec
)

Creates a DynamicColor that is bound to the value of an item of the State. Every time the state value changes, this DynamicColor will animate from its current value to the new value (from the state).

Parameters
@NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey

The source key to a DynamicDataValue with a color value.

@NonNull AnimationParameterBuilders.AnimationSpec animationSpec

The animation parameters.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor animate(@ColorInt int start, @ColorInt int end)

Creates a DynamicColor which will animate over the range of colors from start to end.

Parameters
@ColorInt int start

The start value of the range.

@ColorInt int end

The end value of the range.

animate

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor animate(
    @ColorInt int start,
    @ColorInt int end,
    @NonNull AnimationParameterBuilders.AnimationSpec animationSpec
)

Creates a DynamicColor which will animate over the range of colors from start to end with the given animation parameters.

Parameters
@ColorInt int start

The start value of the range.

@ColorInt int end

The end value of the range.

@NonNull AnimationParameterBuilders.AnimationSpec animationSpec

The animation parameters.

constant

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor constant(@ColorInt int constant)

Creates a constant-valued DynamicColor.

from

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull DynamicBuilders.DynamicColor from(
    @NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey
)

Creates a DynamicColor that is bound to the value of an item of the State.

Parameters
@NonNull DynamicDataKey<DynamicBuilders.DynamicColor> dynamicDataKey

The source key to a DynamicDataValue with a color value.

fromByteArray

Added in 1.0.0
default static @NonNull DynamicBuilders.DynamicColor fromByteArray(@NonNull byte[] byteArray)

Creates a DynamicColor from a byte array generated by toDynamicColorByteArray.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization

fromByteArray

Added in 1.0.0
default static @NonNull DynamicBuilders.DynamicColor fromByteArray(@NonNull byte[] byteArray, int offset, int length)

Creates a DynamicColor from the provided byte array at the provided offset and length, that was generated by one of the toDynamicColorByteArray overloads.

Throws
java.lang.IllegalArgumentException

if the byte array does not contain a valid serialization in the provided offset and length

onCondition

Added in 1.0.0
@RequiresSchemaVersion(major = 1, minor = 200)
default static @NonNull ConditionScopes.ConditionScope<DynamicBuilders.DynamicColorIntegeronCondition(@NonNull DynamicBuilders.DynamicBool condition)

Bind the value of this DynamicColor to the result of a conditional expression. This will use the value given in either use or elseUse depending on the value yielded from condition.

toDynamicColorByteArray

Added in 1.0.0
default @NonNull byte[] toDynamicColorByteArray()

Serializes the DynamicColor into a new byte array that can later be used with fromByteArray.

toDynamicColorByteArray

Added in 1.0.0
default int toDynamicColorByteArray(@NonNull byte[] byteArray)

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, that can later be used with DynamicColor.fromByteArray(byteArray, 0, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small

toDynamicColorByteArray

Added in 1.0.0
default int toDynamicColorByteArray(@NonNull byte[] byteArray, int offset, int length)

Serializes the DynamicColor into the provided byte array, returning the amount of bytes written, limited by the provided offset and length, that can later be used with DynamicColor.fromByteArray(byteArray, offset, bytesWritten).

Throws
java.lang.IllegalArgumentException

if the byte array is too small