[orx-shadestyles] Improve gradient and imageFill shadestyles

This commit is contained in:
Edwin Jakobs
2025-02-25 12:16:57 +01:00
parent 21a3d7f483
commit 9a93d95318
30 changed files with 1296 additions and 386 deletions

View File

@@ -0,0 +1,36 @@
package gradients
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.color.presets.BLUE_STEEL
import org.openrndr.extra.color.spaces.OKHSV
import org.openrndr.extra.color.tools.shiftHue
import org.openrndr.extra.shadestyles.fills.SpreadMethod
import org.openrndr.extra.shadestyles.fills.gradients.gradient
import org.openrndr.math.Vector2
fun main() {
application {
configure {
width = 720
height = 720
}
program {
extend {
drawer.shadeStyle = gradient<ColorRGBa> {
for (i in 0 .. 10) {
stops[i/10.0] = ColorRGBa.RED.shiftHue<OKHSV>(i * 36.0)
}
spreadMethod = SpreadMethod.REFLECT
conic {
center = Vector2(0.5, 0.5)
angle = 360.0
rotation = seconds * 10.0
}
}
drawer.rectangle(drawer.bounds)
}
}
}
}