drawRect

abstract fun drawRect(paint: Paint, x: Float = 0.0f, y: Float = 0.0f, width: Float = size.width.toFloat() - x, height: Float = size.height.toFloat() - y, style: DrawStyle = DrawStyle.Fill, @FloatRange(from = 0.0, to = 1.0) alpha: Float = 1.0f)

Draws a rectangle with the specified bounds. Defaults to covering the entire surface.

Parameters

paint

the paint or color used to render the rectangle.

x

horizontal coordinate of the top-left corner.

y

vertical coordinate of the top-left corner.

width

width of the rectangle.

height

height of the rectangle.

style

whether to fill or outline the rectangle.

alpha

the opacity to render with.