Colors: manipulate colors

Colors: manipulate colors

pymt.graphx.colors.set_color(*colors, **kwargs)

Define current color to be used (as float values between 0 and 1)

set_color(1, 0, 0, 1)
drawLabel('Hello', pos=(100, 0))
set_color(0, 1, 0, 1)
drawLabel('World', pos=(200, 0))
Parameters :
*colors : list

Can have 3 or 4 float value (between 0 and 1)

sfactor : opengl factor, default to GL_SRC_ALPHA

Default source factor to be used if blending is activated

dfactor : opengl factor, default to GL_ONE_MINUS_SRC_ALPHA

Default destination factor to be used if blending is activated

blend : boolean, default to None

Set True if you really want to activate blending, even if the alpha color is 1 (mean no blending in theory)

Previous topic

Bezier: handle curve based on bezier path

Next topic

CSS: Draw shapes with css attributes !

This Page