-
Notifications
You must be signed in to change notification settings - Fork 6.5k
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
Feature/lab color representation #12935
Feature/lab color representation #12935
Conversation
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentAccessible coc djsoref dogancelik estdir Fody ftps gmx htt inprivate itsme mfreadwrite mfuuid Nefario nitroin null nunit Radiobuttons sidepanel ulazy XSmall xunitSome files were were automatically ignoredThese sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:RubenFricke/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
@martinchrzan , As I stated above in the pull request description Do you happen to know the answer to this? Or someone who can answer this? Thanks again! |
Yeah, I think adding these links to summary would be helpful.
…On Sat, 28 Aug 2021, 18:46 Ruben Fricke, ***@***.***> wrote:
***@***.**** commented on this pull request.
------------------------------
In src/modules/colorPicker/ColorPickerUI/Helpers/ColorHelper.cs
<#12935 (comment)>:
> + double b = color.B / 255d;
+
+ // inverse companding, gamma correction must be undone
+ double rLinear = (r > 0.04045) ? Math.Pow((r + 0.055) / 1.055, 2.4) : (r / 12.92);
+ double gLinear = (g > 0.04045) ? Math.Pow((g + 0.055) / 1.055, 2.4) : (g / 12.92);
+ double bLinear = (b > 0.04045) ? Math.Pow((b + 0.055) / 1.055, 2.4) : (b / 12.92);
+
+ return (
+ (rLinear * 0.4124) + (gLinear * 0.3576) + (bLinear * 0.1805),
+ (rLinear * 0.2126) + (gLinear * 0.7152) + (bLinear * 0.0722),
+ (rLinear * 0.0193) + (gLinear * 0.1192) + (bLinear * 0.9505)
+ );
+ }
+
+ /// <summary>
+ /// Convert a CIE XYZ color <see cref="double"/> to a CIE LAB color (LAB)
Thanks a lot for your feedback, I really appreciate it 😄!
For converting from sRGB to XYZ, I used, among others, this page:
https://en.wikipedia.org/wiki/SRGB#The_reverse_transformation_(sRGB_to_CIE_XYZ)
For converting from XYZ to L*a*b*, I used, among others, this page:
https://en.wikipedia.org/wiki/CIELAB_color_space#Converting_between_CIELAB_and_CIEXYZ_coordinates
.
Should I refer these pages in the code as well (in the summary)?
—
You are receiving this because your review was requested.
Reply to this email directly, view it on GitHub
<#12935 (comment)>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AC3JYIWFYNQV6BI3XRRW5KLT7EHGRANCNFSM5C6DCPPQ>
.
|
@RubenFricke I would guess that you can include that color format in this PR as well since you have already added a code to calculate it, but I would create a new issue and refer to it from this PR, so we can keep a track of it. |
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentAccessible coc djsoref dogancelik estdir Fody ftps gmx htt inprivate itsme mfreadwrite mfuuid Nefario nitroin null nunit Radiobuttons sidepanel ulazy XSmall xunitSome files were were automatically ignoredThese sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:RubenFricke/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
@check-spelling-bot ReportUnrecognized words, please review:
Previously acknowledged words that are now absentAccessible CIEXYZ coc djsoref dogancelik estdir Fody ftps gmx htt inprivate itsme mfreadwrite mfuuid Nefario nitroin null nunit Radiobuttons sidepanel ulazy XSmall xunitSome files were were automatically ignoredThese sample patterns would exclude them:
You should consider adding them to:
File matching is via Perl regular expressions. To check these files, more of their words need to be in the dictionary than not. You can use To accept these unrecognized words as correct (and remove the previously acknowledged and now absent words), run the following commands... in a clone of the git@github.com:RubenFricke/PowerToys.git repository
If you see a bunch of garbageIf it relates to a ... well-formed patternSee if there's a pattern that would match it. If not, try writing one and adding it to the Patterns are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your lines. Note that patterns can't match multiline strings. binary-ish stringPlease add a file path to the File paths are Perl 5 Regular Expressions - you can test yours before committing to verify it will match your files.
|
src/modules/colorPicker/ColorPickerUI/Helpers/ColorRepresentationHelper.cs
Show resolved
Hide resolved
Thanks for all your feedback @mykhailopylyp . I will look into it! |
@RubenFricke / @mykhailopylyp what needs to happen so we can roll this improvement into the 0.47 release at the end of the month. |
@crutkas , from the feedback, looks like the calculations are still not quite right for the color format. |
@jaimecbernardo is this something we can just do a quick fix for? |
I will fix the calculations, sorry! Only question, what format do you want to output? |
I'm not sure which is the standard here. Which would be useful to you? |
Changed L*a*b*(L,a,b) to CIELab(L,a,b)
@RubenFricke |
@jaimecbernardo / @dedavis6797 do we have time for this to be in .47? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This looks good to me.
Thank you for the contribution.
I do have some questions regarding presentation of the values.
Looking for those in other sites show these values presented with some decimal places. Why are we not showing these as well?
src/modules/colorPicker/ColorPickerUI/Helpers/ColorRepresentationHelper.cs
Outdated
Show resolved
Hide resolved
src/modules/colorPicker/ColorPickerUI/Helpers/ColorRepresentationHelper.cs
Outdated
Show resolved
Hide resolved
Reviewing. Let's try to get this in, then. |
@RubenFricke , |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I've added the decimal places and committed the changes.
Thank you for the contribution!
Summary of the Pull Request
Added CIE LAB and CIE XYZ color space to the Color Picker.
What is include in the PR:
This pull request adds the CIE LAB color space, also referred to as L* a* b* and the CIE XYZ color space to the Color Picker. To calculate the CIELAB space from RGB, a conversion from RGB to CIEXYZ had to be made, this conversion is also included in this pull request.
How does someone test / validate:
Open Color Picker, and validate that the CIE LAB and CIE XYZ color space are visible, if these color spaces are enabled via the settings.
Validate that the output of the color is correct (use online available color conversion websites if you don't have any tool available)
Quality Checklist
Contributor License Agreement (CLA)
A CLA must be signed. If not, go over here and sign the CLA. ✅