[orx-palette] Add nextColor(2) for easy palette permutations (#140)

This commit is contained in:
Ricardo Matias
2020-07-22 21:34:09 +02:00
committed by GitHub
parent 55b914cac1
commit 94e52367e4

View File

@@ -51,6 +51,14 @@ class PaletteStudio(
var randomizeKey = 'k'
private var paletteIndex: Int = 0
var nextColorIndex: Int = 0
get() {
return field++ % colors.size
}
var nextColor2Index: Int = 0
get() {
return field++ % colors2.size
}
enum class SortBy {
NO_SORTING, DARKEST, BRIGHTEST
@@ -196,6 +204,12 @@ class PaletteStudio(
return paletteIndex
}
val nextColor: ColorRGBa
get() = colors[nextColorIndex]
val nextColor2: ColorRGBa
get() = colors2[nextColor2Index]
fun randomize() {
palette = assemblePalette(colors.shuffled())
}