Layer.colorRect

Function/Meaning
Rectangular translucent fill
Type
Method of Layer class
Syntax
colorRect(left, top, width, height, value, opa=255)
Arguments
left Specifies the left position of the rectangle to fill, in pixels (relative to the image position).
top Specifies the top position of the rectangle to fill, in pixels (relative to the image position).
width Specifies the width of the rectangle to fill, in pixels (relative to the image position).
height Specifies the height of the rectangle to fill, in pixels (relative to the image position).
value Specifies the color or value to fill.
The meaning of this value changes depending on the value of the Layer.face property.
dfAlpha (or dfBoth) : Specify the color in 0xRRGGBB format
dfAddAlpha : Specify the color in 0xRRGGBB format
dfOpaque (or dfMain) : Specify the color in 0xRRGGBB format
dfMask : Specify the mask (opacity) value (0 to 255)
dfProvince : Specify the province (region) value (0 to 255)
When dfOpaque is specified, mask information is ignored (whether mask information is preserved or destroyed depends on the Layer.holdAlpha property). Also, when dfMask is specified, the color information remains unchanged.
In the case of dfAlpha, if opa is negative, this argument is ignored.
opa Specifies the opacity to fill with (-255 to 0 to 255).
This argument is ignored if the Layer.face property is dfMask or dfProvince (always fully opaque).
Specifying a negative number is only valid when Layer.face is dfAlpha; in this case, the value argument is ignored and opacity is removed from the image ( specifying -255 makes the rectangle completely transparent).
Return Value
None (void)
Description
Fills the specified rectangle of the layer image in the specified manner.
Unlike Layer.fillRect, you can specify the opacity and fill with translucency.