openrndr / orx

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

[orx-color] OKHSL and XSLUV gradient not showing correct colors #290

Closed hamoid closed 10 months ago

hamoid commented 1 year ago

Operating System

Linux

OPENRNDR version

332c3d96aa88a00725fd9997ebbd939102d0233a

ORX version

97ecb7ca1469bc71d3eb3adb23ffc2b7740ce5f4

Java version (if applicable)

No response

Describe the bug

Running orx-color/src/jvmDemo/kotlin/DemoColorRange03.kt looks like

image

println(colorA)
//ColorRGBa(r=0.0, g=0.0, b=1.0, alpha=1.0, linearity=SRGB)

println(colorA.toOKHSLa().toRGBa())
//ColorRGBa(r=2.2089660991486683E-8, g=9.688447947353573E-8, b=0.9999999650405803, alpha=1.0, linearity=SRGB)

println(colorA.toHSLUVa().toRGBa())
//ColorRGBa(r=2.315999999941143E-5, g=-7.939999999727332E-6, b=1.00000355, alpha=1.0, linearity=LINEAR)

println(colorA.toXSLUVa().toRGBa())
//ColorRGBa(r=0.1778681892764366, g=1.2494697387139403E-5, b=0.4761564930232165, alpha=1.0, linearity=LINEAR)

ps. to adjust the window size so it's not cropped add

        configure {
            height = 11 * 50 + 30
        }

to DemoColorRange03.kt.

Steps to reproduce the bug

No response

edwinRNDR commented 10 months ago

Fixed in 0b87c9687d5e2b450e80d0d82e72ab7a8eeb8a94 and 3dd29f5128ac4e5b45d4b0e75eec7a22d83bd466