Lore archive · Warcraft Wiki, 2023 dump
ColorGradient
Last wiki revision 2021-04-27
Converts a percent value into a gradient from 2 or more RGB percent values (0.0-1.0). If more than 2 colors are passed, the gradient will be between the two colors which perc lies in an evenly divided range.
(Note that if you will always be generating a gradient between the same number of colors, you will see *significantly* greater performance if you customize this function to take a fixed number of arguments.)
The same function, changed to accept only 3 colors and optimize speed.
For this example we'll use 3 colors: red, yellow and green. For a percent value of 0.75 we'd expect to get back a color that's halfway between yellow and green. 0.5 would yield pure yellow, 0.25 would yield an orange.
Source
https://warcraft.wiki.gg/wiki/ColorGradient · retrieved 2023-11-13 · CC BY-SA 4.0
Converted from wikitext with templates, tables and images removed, so some sentences may be missing values.
This archive predates WoW: Forever. For collected gameplay facts see the Forever database. Search the archive.