openrndr / orx

A growing library of assorted data structures, algorithms and utilities for OPENRNDR
https://openrndr.org
BSD 2-Clause "Simplified" License
119 stars 35 forks source link

[orx-gui] `gui.add(linearGradient)` fails when using OKLab colors #264

Open hamoid opened 1 year ago

hamoid commented 1 year ago

Operating System

Linux

OPENRNDR version

from git

ORX version

from git

Java version (if applicable)

No response

Describe the bug

↑ class org.openrndr.extra.color.spaces.ColorOKLABa cannot be cast to class org.openrndr.color.ColorRGBa (org.openrndr.extra.color.spaces.ColorOKLABa and org.openrndr.color.ColorRGBa are in unnamed module of loader 'app') (ClassCastException) 

Steps to reproduce the bug

import org.openrndr.application
import org.openrndr.color.ColorRGBa
import org.openrndr.extra.color.spaces.toOKLABa
import org.openrndr.extra.gui.GUI
import org.openrndr.extra.shadestyles.LinearGradientOKLab

fun main() = application {
    program {
        val g = LinearGradientOKLab(
            ColorRGBa.RED.toOKLABa(),
            ColorRGBa.GREEN.toOKLABa()
        )

        extend(GUI()) { add(g, "linear gradient") }
        extend {}
    }
}
hamoid commented 7 months ago

Issue still present on 0b87c96