9.15. rgba

class itom.rgba(r, g, b, alpha=255) → creates a new color value from red, green, blue and optional alpha
Parameters

r : {uint8}

red component [0,255]

g : {uint8},

green component [0,255]

b : {uint8}

blue component [0,255]

alpha : {uint8}, optional

alpha component [0,255], default: 255 (no transparancy)

Notes

For a gray value set all colors to the same value.

name()
toGray() -> returns the gray value from the color (alpha is not considered)

The returned gray value is a float value and calculated by 0.299 * r + 0.587 * g + 0.114 * b

alpha
b

blue

g

green

r

red