[orx-shade-styles] Add rotation support to pattern dots

This commit is contained in:
Edwin Jakobs
2025-03-10 11:01:54 +01:00
parent 977be4ee6f
commit 557d3bb3ad
4 changed files with 29 additions and 4 deletions

View File

@@ -9,6 +9,7 @@ import org.openrndr.extra.color.presets.LIME_GREEN
import org.openrndr.extra.imageFit.imageFit
import org.openrndr.extra.shadestyles.fills.SpreadMethod
import org.openrndr.extra.shadestyles.fills.gradients.gradient
import org.openrndr.extra.shadestyles.fills.patterns.pattern
fun main() = application {
configure {
@@ -18,10 +19,21 @@ fun main() = application {
program {
val image = loadImage("demo-data/images/image-001.png")
extend {
drawer.shadeStyle = pattern {
foregroundColor = ColorRGBa.WHITE
backgroundColor = ColorRGBa.WHITE.shade(0.75)
checkers {
scale = 72.0
}
}
drawer.rectangle(drawer.bounds.offsetEdges(-10.0))
drawer.shadeStyle = gradient<ColorRGBa> {
stops[0.0] = ColorRGBa.CRIMSON
stops[0.7] = ColorRGBa.DODGER_BLUE
stops[1.0] = ColorRGBa.LIME_GREEN
stops[0.0] = ColorRGBa.CRIMSON.opacify(0.0)
stops[0.19] = ColorRGBa.CRIMSON.opacify(0.0)
stops[0.25] = ColorRGBa.DODGER_BLUE.opacify(1.0)
stops[1.0] = ColorRGBa.LIME_GREEN.opacify(1.0)
spreadMethod = SpreadMethod.REFLECT
luma {