Skip to content

Cannot make oklch color lighter #4343

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

Open
Jagget opened this issue May 20, 2025 · 3 comments
Open

Cannot make oklch color lighter #4343

Jagget opened this issue May 20, 2025 · 3 comments
Labels

Comments

@Jagget
Copy link

Jagget commented May 20, 2025

To reproduce:

Go to Playground: https://lesscss.org/less-preview/#eyJjb2RlIjoiI2xpYigpIHtcbiAgICAuY29sb3JzKCkge1xuICAgICAgQHByaW1hcnk6IGJsdWU7XG4gICAgICBAc2Vjb25kYXJ5OiBncmVlbjtcbiAgICB9XG4gICAgLnJ1bGVzKEBzaXplKSB7XG4gICAgICBib3JkZXI6IEBzaXplIHNvbGlkIHdoaXRlO1xuICAgIH1cbiAgfVxuICBcbiAgLmJveCB3aGVuICgjbGliLmNvbG9yc1tAcHJpbWFyeV0gPSBibHVlKSB7XG4gICAgd2lkdGg6IDEwMHB4O1xuICAgIGJhY2tncm91bmQ6IG9rbGNoKGZyb20gIzAwMDBGRiBjYWxjKGwgLSAwLjEpIGMgaCk7XG4gICAgaGVpZ2h0OiAoJHdpZHRoIC8gMik7XG4gIH1cbiAgXG4gIC5iYXI6ZXh0ZW5kKC5ib3gpIHtcbiAgICBAbWVkaWEgKG1pbi13aWR0aDogNjAwcHgpIHtcbiAgICAgIHdpZHRoOiAyMDBweDtcbiAgICAgICNsaWIucnVsZXMoMXB4KTtcbiAgICB9XG4gIH0iLCJhY3RpdmVWZXJzaW9uIjoiNC4zLjAiLCJtYXRoIjoicGFyZW5zLWRpdmlzaW9uIiwic3RyaWN0VW5pdHMiOmZhbHNlfQ==

Change

// Take blue and make it a bit darker
background: oklch(from #0000FF calc(l - 0.1) c h); 

to

// Take blue and make it a bit lighter
background: oklch(from #0000FF calc(l + 0.1) c h);

Current behavior:

Error: Could not parse call arguments or missing ')'

Expected behavior:

Parse color manipulations properly

Environment information:

  • less version: 4.3.0
@Jagget Jagget added the bug label May 20, 2025
Copy link

dosubot bot commented May 20, 2025

Hello @Jagget! I'm Dosu, your friendly bot here to help you solve bugs, answer questions, and assist you on your journey to becoming a contributor. I'm here while you wait for a human maintainer. How can I assist you today?

The error you're encountering with the oklch function in Less version 4.3.0 seems to be related to the parsing of the function's arguments. Unfortunately, I couldn't find specific documentation or examples for the oklch function in the Less codebase, which might help clarify the correct syntax or usage .

However, based on typical usage patterns for color manipulation functions in Less, you might want to ensure that the syntax for the oklch function is correct and that the arguments are being passed in a format that Less can interpret. If the function is not parsing correctly, it could be due to an issue with how the calc function is being used within the oklch function.

You might try simplifying the expression or checking if there are any updates or patches related to the oklch function in the Less repository that address this issue. Additionally, verifying the syntax against any available documentation or examples could be helpful.

To continue talking to Dosu, mention @dosu.


Help Dosu learn! Give it feedback: Great Response | Irrelevant Answer | Incorrect Sources | Too Verbose | Hallucination | Bug Report | Other

@puckowski
Copy link
Contributor

Thank you for reporting the issue. I'll take a look this weekend, see if I can come up with a PR.

@Jagget
Copy link
Author

Jagget commented May 20, 2025

It also doesn't parse multiplication:

    background-color: oklch(from #0000FF calc(l * 0.5) c h);

puckowski added a commit to puckowski/less.js that referenced this issue May 23, 2025
* Add missing color operand support to resolve issue less#4343.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants