Layer.colorRect

Function/Meaning

Rectangle translucent fill

Type
Layerclassmethod of
Syntax
colorRect(left, top, width, height, value, opa=255)
Arguments
left

Specifies the left edge position of the fill rectangle in pixels (at the image position).

top

Specifies the top position of the rectangle to fill in pixels (at the image position).

width

Specifies the width of the rectangle to fill in pixels (at the image position).

height

Specifies the height of the rectangle to fill, in pixels (at the image position).

value

Specify the fill color and value.
This value depends 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 a mask (opacity) value (0 to 255)
  • dfProvince : Specify a region value (0 to 255) If you specify dfOpaque, the mask information is ignored (whether the mask information is retained or destroyed depends on the Layer.holdAlpha property). Also, if you specify dfMask, the color information remains the same. This argument is ignored for dfAlpha and if opa is negative.
opa

Specifies the opacity to fill (-255 to 0 to 255).
This argument is ignored if the value of the Layer.face property is dfMask or dfProvince (always completely opaque).
Negative numbers are valid only if Layer.face is dfAlpha, in which case the value argument is ignored and the image is stripped of opacity (-255 makes the rectangle completely transparent). ..

Return value
None (void)
Explanation

Fills the rectangle of the specified layer image in the specified way.
Unlike Layer.fillRect, you can specify transparency to fill with translucency.