Tile - YColor - Lerp – Ylands

From Bohemia Interactive Community
Jump to navigation Jump to search
No edit summary
(Added explanation and examples)
Line 2: Line 2:
*'''Interpolates''' between two [[Ylands Tile - Color literal|'''colors''']] '''A''' and '''B''' by the '''interpolant''' '''T'''.  
*'''Interpolates''' between two [[Ylands Tile - Color literal|'''colors''']] '''A''' and '''B''' by the '''interpolant''' '''T'''.  
*The '''interpolant''' is [[Ylands Tile - Math clamp|'''clamped''']] to the range 0, 1.
*The '''interpolant''' is [[Ylands Tile - Math clamp|'''clamped''']] to the range 0, 1.
This tile returns a single Color that is between '''Color A''' and '''Color B'''. The '''interpolant T''' will determine how similar it is to each color. For example, if it is 0.7, it will be 70% of Color B and 30% of Color A.
It can be used to make a gradient between the two colors.
Examples:
{|
|-
|Simple option:
|-
|[[File:Ylands Tile - Color Lerp Simple Example.png|thumb]]
|-
|Advanced option:
|-
|[[File:Ylands Tile - Color Lerp Advanced Example.png|thumb]]
|-
|Before:
|-
|[[File:Ylands Tile - Color Lerp Advanced Example Setup.png|thumb]]
|-
|After:
|-
|[[File:Ylands Tile - Color Lerp Simple Example Output.png|thumb]]
|}


----
----

Revision as of 03:01, 21 November 2020

Color lerp.png

  • Interpolates between two colors A and B by the interpolant T.
  • The interpolant is clamped to the range 0, 1.

This tile returns a single Color that is between Color A and Color B. The interpolant T will determine how similar it is to each color. For example, if it is 0.7, it will be 70% of Color B and 30% of Color A. It can be used to make a gradient between the two colors.

Examples:

Simple option:
Ylands Tile - Color Lerp Simple Example.png
Advanced option:
Ylands Tile - Color Lerp Advanced Example.png
Before:
Ylands Tile - Color Lerp Advanced Example Setup.png
After:
Ylands Tile - Color Lerp Simple Example Output.png

Template:Ylands scripting navbox