Differences
This shows you the differences between two versions of the page.
| Next revision | Previous revision | ||
| interactivesvg:gradientcolourrgb [2022/11/30 05:50] – created optrix | interactivesvg:gradientcolourrgb [2025/12/18 22:50] (current) – external edit 127.0.0.1 | ||
|---|---|---|---|
| Line 1: | Line 1: | ||
| + | ====GradientColourRGB==== | ||
| + | This function takes a value, and an array of value-colour combinations (usually created from [[GRADIENT_]]). | ||
| + | |||
| + | It returns a colour that smoothly interpolates between the various values, allowing you to smoothly transition between colours as the value animates. | ||
| + | |||
| + | ===Example=== | ||
| + | |||
| + | < | ||
| + | var colourtouse = GradientColourRGB(myvalue, | ||
| + | </ | ||
| + | |||
| + | In the above example, a number between 0-1 named **myvalue** is converted into a colour. | ||
| + | |||
| + | The colour will be red at 0, will fade to green at 0.4 and then fade to red at 1. | ||
| + | |||
| + | The individual colours passed to GradientColourRGB are actually an array of three values in red-green-blue order - the // | ||