Skip to content

ColorRange

0880 edited this page Apr 5, 2024 · 1 revision

Constructors

ColorRange()

  • Initializes a color range with a default starting point at time 0 with the color red.

ColorRange(float[] timeline, Color... colors)

  • Initializes a color range with the given timeline and colors. The length of the timeline array must be equal to the number of colors.

Methods

add(float t, Color color)

  • Adds a point in time with the corresponding color to the color range.

remove(int index)

  • Removes the point in time and the corresponding color at the specified index from the color range.

insert(int index, float time, Color color)

  • Inserts a point in time with the corresponding color at the specified index in the color range.

getTime(int index)

  • Returns the point in time at the specified index.

setTime(int index, float time)

  • Sets the point in time at the specified index.

getColor(int index)

  • Returns the color at the specified index.

valueAt(Color color, float t)

  • Returns the interpolated color value at the given point in time t.

size()

  • Returns the number of points in the color range.

getColors()

  • Returns the ArrayList of colors defining the color range.

Clone this wiki locally