[orx-palette] Add ColorBrewer2, demos, update README (#363)

This commit is contained in:
Abe Pazos
2025-09-02 06:38:30 +02:00
committed by GitHub
parent af4c2b20d6
commit d1e5ba634d
14 changed files with 3057 additions and 66 deletions

View File

@@ -0,0 +1,31 @@
import org.openrndr.application
import org.openrndr.extra.palette.PaletteStudio
/**
* Demonstrates how to access palette colors using PaletteStudio.
* A new random palette is loaded every 60 animation frames.
*/
fun main() = application {
configure {
width = 720
height = 720
}
program {
val paletteStudio = PaletteStudio()
// Choose a specific initial palette
paletteStudio.select(11)
extend {
if(frameCount % 60 == 50) {
paletteStudio.randomPalette()
}
drawer.clear(paletteStudio.background)
paletteStudio.colors2.forEachIndexed { i, color ->
drawer.fill = color
drawer.circle(drawer.bounds.center, 300.0 - i * 40.0)
}
}
}
}