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

Parsing lab is still wrong #14

Open
mazznoer opened this issue Jul 23, 2022 · 0 comments
Open

Parsing lab is still wrong #14

mazznoer opened this issue Jul 23, 2022 · 0 comments

Comments

@mazznoer
Copy link
Owner

From https://www.w3.org/TR/css-color-4/#predefined-xyz, these are exactly equivalent:

#7654CD
rgb(46.27% 32.94% 80.39%)
lab(44.36% 36.05 -58.99)

But the test is fails for lab.

let test_data = [
("transparent", "rgb(0,0,0,0%)"),
("#FF9900", "#f90"),
("#aabbccdd", "#ABCD"),
("#BAD455", "BAD455"),
("rgb(0 255 127 / 75%)", "rgb(0,255,127,0.75)"),
("hwb(180 0% 60%)", "hwb(180,0%,60%)"),
("hwb(290 30% 0%)", "hwb(290 0.3 0)"),
("hsl(180,50%,27%)", "hsl(180,0.5,0.27)"),
("rgb(255, 165, 0)", "hsl(38.824 100% 50%)"),
("#7654CD", "rgb(46.27% 32.94% 80.39%)"),
//#[cfg(feature = "lab")]
//("#7654CD", "lab(44.36% 36.05 -58.99)"),
];
for (a, b) in test_data {
assert_eq!(parse(a).unwrap().to_rgba8(), parse(b).unwrap().to_rgba8());
}

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