API Reference › Tween › Tween.tint
method

Tween.tint

Tween.tint(from, to, t) -> int

Blends two colors (0x00RRGGBB ints) channel by channel by amount t — the color equivalent of Tween.number. Fade a sprite to white on hit, cross-fade a sky, or pulse a UI accent. Matches Color.lerp, ready for an eased t from Tween.ease.

Parameters

fromthe color at t = 0 (an int, 0x00RRGGBB)
tothe color at t = 1 (an int, 0x00RRGGBB)
tthe blend amount (a fixed, usually 0..1)

Example

program Demo {
  handler Run phase Update {
    let t = Tween.progress(fixed(1), fixed(2))
    let c = Tween.tint(Color.rgb(0, 0, 0), Color.rgb(255, 255, 255), t)
    print(c)
  }
}
← All symbols