Skip to content

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

@hamoid

Description

@hamoid

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.linearGradient

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

        extend(GUI()) { add(g, "linear gradient") }
        extend {
            drawer.shadeStyle = g
            drawer.rectangle(drawer.bounds)
        }
    }
}

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions