Currently colors are represented in tingbot using tuples or strings. While this is convenient, it holds us back from adding functionality around colors e.g. blending, darker/lighter methods, HSL constructors.
I propose a Color type to solve this. Common usage will be using a rgb() or rgba() constructor functions:
Currently colors are represented in tingbot using tuples or strings. While this is convenient, it holds us back from adding functionality around colors e.g. blending, darker/lighter methods, HSL constructors.
I propose a Color type to solve this. Common usage will be using a
rgb()
orrgba()
constructor functions:The syntax deliberately matches the CSS syntax for
rgb
andrgba
. We'll also providehsl
andhsla
functions for color-wheel color picking.More advanced usage using the object directly-
All the graphics routines that take a
color
parameter will continue to accept tuples/strings, and convert to color objects internally.