Skip to content

A few questions about OKLCH color. #2130

Open
@dufu1991

Description

@dufu1991

The v4 version uses OKLCH color mode by default, and I've noticed that the HEX colors in the documentation don't seem to correspond correctly to OKLCH.

For example, for the color value red-500, the colors in the documentation are #ef4444 and oklch (0.637 0.237 25.331), using Chrome, version 133.0.6943.142 (official) (arm64), and using the developer tools to see the hex value for this color, which is #fb2c36, which does not match the #ef4444 shown in the documentation? does not match the #ef4444 shown in the documentation?

Image

In addition, I used https://oklch.com/ to calculate hex and OKLCH, and found that the document is not accurate, I don't know how the tailwindcss.com site's algorithm for converting this color is, and I don't know what the problem is, which calculation is needed to take precedence?

I don't know if it's related to the monitor or not. To add, the device I'm using is a M4 MacBook Pro, and the macOS default color mode is this one, System Settings - Displays.

Image

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions