diff --git a/orx-palette/src/main/kotlin/PaletteStudio.kt b/orx-palette/src/main/kotlin/PaletteStudio.kt index 59fa7e56..1e1bb8aa 100644 --- a/orx-palette/src/main/kotlin/PaletteStudio.kt +++ b/orx-palette/src/main/kotlin/PaletteStudio.kt @@ -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()) }