Skip to content

Values need to be clamped to RGB / P3 gamut #9

@drwpow

Description

@drwpow

Problem

When using the oklab prop, values aren’t clamped to the sRGB (or P3) gamut which results in the picker showing the wrong X, Y if you change the values externally:

CleanShot 2023-09-03 at 15 24 53

What’s happening here is the h, s, v values are updating correctly, however, the v is > 1 so it gets clamped to 1. This results in an “impossible” color that can’t be represented by the picker. When the square is clicked, it clamps back to sRGB space so you see the values correct again.

Solution

Find some way to clamp the colors to RGB space.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions