-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDemoGradient05.kt
39 lines (33 loc) · 1.08 KB
/
DemoGradient05.kt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
package gradients
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.draw.loadFont
import org.openrndr.extra.color.presets.BLUE_STEEL
import org.openrndr.extra.shadestyles.fills.FillUnits
import org.openrndr.extra.shadestyles.fills.SpreadMethod
import org.openrndr.extra.shadestyles.fills.gradients.gradient
fun main() {
application {
configure {
width = 720
height = 720
}
program {
extend {
drawer.shadeStyle = gradient<ColorRGBa> {
stops[0.0] = ColorRGBa.BLACK
stops[0.5] = ColorRGBa.BLUE_STEEL
stops[1.0] = ColorRGBa.WHITE
fillUnits = FillUnits.WORLD
spreadMethod = SpreadMethod.REPEAT
quantization = 10
conic {
angle = 360.0 * 8.0
center = drawer.bounds.position(0.5, 0.5)
}
}
drawer.rectangle(drawer.bounds)
}
}
}
}