Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RGB -> Oklch colors are off #4

Open
atomicptr opened this issue Jun 27, 2024 · 0 comments
Open

RGB -> Oklch colors are off #4

atomicptr opened this issue Jun 27, 2024 · 0 comments

Comments

@atomicptr
Copy link

Hello,

I've noticed that when converting from RGB to oklch the resulting color is somewhat off, here is an example:

<?php

require "vendor/autoload.php";

use matthieumastadenis\couleur\ColorFactory;
use matthieumastadenis\couleur\colors\OkLch;

$color = ColorFactory::newCss("#75a7d1");
$oklch = $color->toOkLch();

echo "oklch({$oklch->lightness}% {$oklch->chroma} {$oklch->hue})";

This returns:

oklch(67.462201399088% 0.14135681535913 261.33802091148)

for me but it should be:

oklch(70.9% 0.082 244.65)

See: https://oklch.com/#70.9,0.082,244.65,100

image

Not sure if I'm doing something wrong here

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant