CmdGradient
From MCS Wiki AVR
Contents |
Action
Draw a smooth color gradient.
Syntax
CmdGradient x0, y0, rgb0, x1, y1, rgb1
Remarks
x0 |
x-coordinate of point 0, in pixels |
y0 |
y-coordinate of point 0, in pixels |
rgb0 |
Color of point 0, as a 24-bit RGB number. r is the most significant 8 bits, b is the least. So &hff0000 is bright red. |
x1 |
x-coordinate of point 1, in pixels |
y1 |
y-coordinate of point 1, in pixels |
rgb1 |
Color of point 1. |
All the colour step values are calculated based on smooth curve interpolated from the rgb0 to rgb1 parameter.
The smooth curve equation is independently calculated for all three colors and the equation used is R0 + t * (R1 - R0), where t is interpolated between 0 and 1.
Gradient must be used with Scissor function to get the intended gradient display