Grid Lines
constructor(color: Color = Color.LightGray, lineWidth: Dp = 1.dp, pathEffect: PathEffect? = null, alpha: Float = 1.0f, colorFilter: ColorFilter? = null, blendMode: BlendMode = DrawScope.DefaultBlendMode, enableHorizontalLines: Boolean = true, enableVerticalLines: Boolean = true, drawHorizontalLines: DrawScope.(Float, Float, Float) -> Unit = { xStart, y, xEnd ->
drawLine(
color = color,
start = Offset(xStart, y),
end = Offset(xEnd, y),
strokeWidth = lineWidth.toPx(),
pathEffect = pathEffect,
colorFilter = colorFilter,
blendMode = blendMode
)
}, drawVerticalLines: DrawScope.(Float, Float, Float) -> Unit = { x, yStart, yEnd ->
drawLine(
color = color,
start = Offset(x, yStart),
end = Offset(x, yEnd),
strokeWidth = lineWidth.toPx(),
pathEffect = pathEffect,
colorFilter = colorFilter,
blendMode = blendMode
)
})
Parameters
color
: Defines the color of the grid lines.
line Width
: Defines the width of the lines.
path Effect
optional effect or pattern to apply to the line.
alpha
Opacity to be applied to the path from 0.0f to 1.0f representing. fully transparent to fully opaque respectively.
color Filter
ColorFilter to apply to the color when drawn into the destination.
blend Mode
Blending algorithm to be applied to the path when it is drawn.
enable Horizontal Lines
False to disable horizontal line else true.
enable Vertical Lines
False to disable vertical lines else true.
draw Horizontal Lines
Draw param used to draw the horizontal lines with given input params.
draw Vertical Lines
Draw param used to draw the vertical lines with given input params.