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

Add Oklab and Oklch #533

Merged
merged 5 commits into from May 19, 2024
Merged

Add Oklab and Oklch #533

merged 5 commits into from May 19, 2024

Conversation

eprovst
Copy link
Contributor

@eprovst eprovst commented Aug 1, 2023

Similar to pull request #518, using the terminology of CSS instead and somewhat more complete. In the sense that there are (some) tests and all conversions seem to dispatch correctly.

Potential further work not in this pull request:

  • Some of the algorithms using CIE Lab/Luv could maybe benefit from a version using Oklab.
  • As CIE Lab (wrt. D65) and Oklab are now part of CSS, colorant string parsing could maybe be extended to support the CSS syntax.

I do get a fail of isempty(detect_ambiguities(Colors)), which I do not completely understand, so help there would be appreciated.

Failing CI is related to the fact that ColorTypes v0.12 is not released.

@eprovst eprovst marked this pull request as ready for review August 7, 2023 15:20
@eprovst
Copy link
Contributor Author

eprovst commented Aug 7, 2023

The failure of isempty(detect_ambiguities(Colors)) seems related to upgrading to ColorTypes v0.12 and not to the other changes in this pull request, so removing the WIP status.

@eprovst
Copy link
Contributor Author

eprovst commented Aug 13, 2023

Modified description to more clearly separate potential improvements from actual contents. I am however not currently planning to add the former, so as far as I am concerned this pull request is complete. (Although someone should maybe verify the detect_ambiguities error first.)

@tpapp
Copy link
Contributor

tpapp commented Feb 5, 2024

This would be a great addition (I found out about OKxxx in a recent discussion).

@eprovst, if maintainers are not responding, I wonder if you could just put this in a separate package, called ColorsOK.jl or something, depending on ColorTypes.jl and Colors.jl.

Project.toml Outdated Show resolved Hide resolved
@kimikage
Copy link
Collaborator

from a Slack thread: https://julialang.slack.com/archives/CB1R90P8R/p1715468813588759

kimikage
Since many of the changes I made 3 years ago will require manual merging, I do not plan to make any changes in v0.12 other than fatal bug fixes and fixing broken tests.

kimikage
In other words, I believe there is a demand for Oklab and Oklch support to be backported to v0.12, but I would like to cancel the idea.

Of course, it will do not interfere with others doing it properly.
In any case, this PR should be merged into v0.13.0-DEV first, without worrying about the backporting or ColorTypes v0.11.

@eprovst
Copy link
Contributor Author

eprovst commented May 12, 2024

That seems like a reasonable order of actions. If there is anything I should still change, please let me know!

@kimikage
Copy link
Collaborator

I have made a fix so that the CI tests pass, so please rebase and make sure all CI results are green.
As for [compat], I think it is better to fit the current status for the convenience, i.e.,:

ColorTypes = "0.11.5"

We will revisit it at the release timing of ColorTypes v0.12 or Colors v0.13, whichever comes first.

Once this PR is merged, I would like to add the charts to the document and visually verify that the conversion works.
Let's further extend parse after that.

Copy link

codecov bot commented May 15, 2024

Codecov Report

All modified and coverable lines are covered by tests ✅

Project coverage is 98.91%. Comparing base (f0a508b) to head (ab1590d).
Report is 8 commits behind head on master.

Additional details and impacted files
@@            Coverage Diff             @@
##           master     #533      +/-   ##
==========================================
+ Coverage   98.82%   98.91%   +0.08%     
==========================================
  Files          10       10              
  Lines        1281     1289       +8     
==========================================
+ Hits         1266     1275       +9     
+ Misses         15       14       -1     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@eprovst eprovst marked this pull request as draft May 15, 2024 06:22
@eprovst
Copy link
Contributor Author

eprovst commented May 15, 2024

Suddenly convert(RGB, Oklab{Float64}(0.0,1.0,0.5)) fails... Investigating further. I was on the main branch...... Never mind.

@eprovst eprovst marked this pull request as ready for review May 15, 2024 06:44
@eprovst
Copy link
Contributor Author

eprovst commented May 15, 2024

I have made a fix so that the CI tests pass, so please rebase and make sure all CI results are green. As for [compat], I think it is better to fit the current status for the convenience, i.e.,:

ColorTypes = "0.11.5"

We will revisit it at the release timing of ColorTypes v0.12 or Colors v0.13, whichever comes first.

Once this PR is merged, I would like to add the charts to the document and visually verify that the conversion works. Let's further extend parse after that.

I already took the liberty to add the charts, which seem alright. Tests also seem to pass.

Copy link
Collaborator

@kimikage kimikage left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you for responding to some of the modifications.

There is no explicit policy about the tolerance here, but it would be better to be able to notice unintended changes more easily.

I also confirmed that the charts are displayed as it seems.
Personally, I think it would be better to group charts by (Lab, Luv, Oklab) and (LCHab, LCHuv, Oklch) for easier comparison (in PC display).
However, that is a matter of preference and can be changed separately from this PR.

test/conversion.jl Outdated Show resolved Hide resolved
test/conversion.jl Outdated Show resolved Hide resolved
@eprovst
Copy link
Contributor Author

eprovst commented May 15, 2024

I made the tests a bit stricter. I'll leave organization of the documentation to your discretion 🙂

@kimikage
Copy link
Collaborator

I am going to merge this.
It has been over 2 years counting from PR #518. I apologize for that and express thanks to all involved.

@kimikage kimikage merged commit 5c678f2 into JuliaGraphics:master May 19, 2024
19 checks passed
@eprovst eprovst deleted the oklab branch May 19, 2024 07:27
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

Successfully merging this pull request may close these issues.

None yet

4 participants