-
Notifications
You must be signed in to change notification settings - Fork 37
/
Copy pathDemoRectangleGrid03.kt
39 lines (31 loc) · 1.12 KB
/
DemoRectangleGrid03.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 primitives
import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.shapes.primitives.bounds
import org.openrndr.extra.shapes.primitives.grid
import org.openrndr.extra.shapes.primitives.get
import org.openrndr.shape.bounds
fun main() = application {
configure {
width = 720
height = 720
}
program {
val grid = drawer.bounds.grid(12, 5)
extend {
drawer.stroke = ColorRGBa.WHITE
drawer.fill = null
drawer.rectangles(grid.flatten())
drawer.fill = ColorRGBa.GRAY.shade(0.4).opacify(0.5)
drawer.rectangle(grid[1..10, 0..4].bounds)
drawer.fill = ColorRGBa.PINK.shade(0.5).opacify(0.5)
drawer.rectangle(grid[5..6, 1].bounds)
drawer.fill = ColorRGBa.PINK.opacify(0.5)
drawer.rectangle(grid[2..5, 2].bounds)
drawer.fill = ColorRGBa.GRAY.opacify(0.5)
drawer.rectangle(grid[6..9, 2].bounds)
drawer.fill = ColorRGBa.GRAY.shade(0.5).opacify(0.5)
drawer.rectangle(grid[5..6, 3].bounds)
}
}
}