Parent Userdata Library display.* Revision Release 2022.3683 Keywords paint, fill, stroke See also object.fill object.stroke Filters/Generators/Composites (guide)
For object fills and strokes, Corona uses the concept of paint. Once a paint is declared, it can be applied to objects via object.fill and object.stroke.
Solid fills and strokes are specified by an array of color channels. For other fill/stroke types, including images, composites, and gradients, please see:
{ gray } { gray, alpha } { red, green, blue } { red, green, blue, alpha }
Numbers. Numbers between 0
and 1
that represent the corresponding value for that channel. alpha
represents the opacity of the object.
local paint = { 0.5 } local rect = display.newRect( 200, 300, 300, 300 ) rect.fill = paint
local paint = { 1, 0, 0.5 } local rect = display.newRect( 200, 300, 300, 300 ) rect.fill = paint