class ColorRamp


Describes an optional color ramp for the progress bar associated with RangedValueComplicationData or GoalProgressComplicationData. This is a rendering hint that overrides the normal watch face colors when there's a particular semantic meaning. E.g. red to blue for a ranged value representing temperature.

Note this is a subset of the functionality of android.graphics.LinearGradient and the x & y coordinates for the ramp are not known to the complication data source.

Summary

Public constructors

ColorRamp(colors: @ColorInt IntArray, interpolated: Boolean)

Public functions

open operator Boolean
equals(other: Any?)
open Int
open String

Public properties

IntArray

The colors to render the progress bar with.

Boolean

If true then the colors should be smoothly interpolated when rendering the progress bar.

Public constructors

ColorRamp

Added in 1.2.0
ColorRamp(colors: @ColorInt IntArray, interpolated: Boolean)

Public functions

equals

open operator fun equals(other: Any?): Boolean

hashCode

open fun hashCode(): Int

toString

open fun toString(): String

Public properties

colors

Added in 1.2.0
val colorsIntArray

The colors to render the progress bar with. For RangedValueComplicationData the first color corresponds to RangedValueComplicationData.min and the last color to RangedValueComplicationData.max. For GoalProgressComplicationData the first color corresponds to zero and the last color to GoalProgressComplicationData.targetValue. A maximum of 7 colors may be specified. When rendered the colors must be evenly spread along the progress bar. The colors must be meaningful to the user, e.g. blue = cold, red/yellow = warm.

interpolated

Added in 1.2.0
val interpolatedBoolean

If true then the colors should be smoothly interpolated when rendering the progress bar. If false the colors should be rendered as equal sized regions of solid color, resulting in a noticeable step between each color.