Hi,
Here is one small example of using some gradients along with a gauge widget.
Here is the code and a short description attached,
CLEAR_COLOR_RGB(255, 255, 255)
CLEAR(1, 1, 1)
// *** Draw the invisible circles to make the ARC in the stencil buffer ***
COLOR_MASK(0, 0, 0, 1) // Disable writes of R, G and B to the screen
STENCIL_OP(INCR, INCR) // Set the stencil to increment
COLOR_RGB(0, 0, 255)
BEGIN(POINTS)
POINT_SIZE(1600) // Draw an outer circle defining the outside of the arc
VERTEX2II(200, 200)
COLOR_RGB(0, 255, 0)
POINT_SIZE(800) // Draw an inner circle defining the inside of the arc
VERTEX2II(200, 200)
END()
// *** Draw the gradient arc ***
COLOR_MASK(1, 1, 1, 1) // Enable writes to the colors again
STENCIL_OP(KEEP, KEEP) // Stop the stencil INCR
STENCIL_FUNC(EQUAL, 1, 255) // Only draw where the stencil buffer is =1 which is our arc
SCISSOR_SIZE(100, 100) // Constrain drawing to one half of the arc
SCISSOR_XY(100, 100)
CMD_GRADIENT(200, 150, 0xFFFF00, 100, 200, 0xFF0000) // Draw a gradient from red to yellow
SCISSOR_SIZE(100, 100) // Constrain drawing to the other half of the arc
SCISSOR_XY(200, 100)
CMD_GRADIENT(200, 150, 0xFFFF00, 300, 199, 0x00AA00) // Draw a gradient from yellow to green
// *** Return the stencil and scissor to normal***
STENCIL_FUNC(ALWAYS, 1, 255)
SCISSOR_SIZE(800, 480)
SCISSOR_XY(0, 0)
// *** Draw a gauge with no background or tickmarks ***
COLOR_RGB(0, 0, 0)
CMD_GAUGE(200, 200, 107, OPT_NOBACK | OPT_NOTICKS, 4, 8, 32, 100)
Best Regards, BRT Community