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

Incorrect conversion of HSL/HSLA values #4597

Closed
Comandeer opened this issue Mar 31, 2021 · 4 comments · Fixed by #4633
Closed

Incorrect conversion of HSL/HSLA values #4597

Comandeer opened this issue Mar 31, 2021 · 4 comments · Fixed by #4633
Assignees
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Milestone

Comments

@Comandeer
Copy link
Member

Type of report

Bug

Provide detailed reproduction steps (if any)

  1. Open browser console.
  2. Go to https://jsfiddle.net/7Ljwqmtz/1/
  3. Check console.

Expected result

Colors in the same console row should be the same.

Actual result

Colors are different. The second parameter changed from 50% to 0%.

Other details

  • CKEditor version: 4.16.0
@Comandeer Comandeer added type:bug A bug. status:confirmed An issue confirmed by the development team. core The issue is caused by the editor core code. size:XS labels Mar 31, 2021
@Comandeer
Copy link
Member Author

Another case:

hsla(123,0%,50%,0.5)hsla(0,0%,50.19607843137255%,0.5)

@Comandeer
Copy link
Member Author

Another case:

hsla( 123, 10%, 10%, 0.5 )hsla(120,0%,10%,0.5)

@Comandeer Comandeer self-assigned this Apr 19, 2021
@f1ames f1ames added this to the 4.16.1 milestone Apr 20, 2021
@Comandeer
Copy link
Member Author

Ok, so there's a small issue… Different HSL values produce the same color. Therefore our conversion algorithm works correctly (despite one thing mentioned below). To avoid losing the real input data from HSL, we will probably need to save it alongside RGB ones.

And there's also a normal bug in our algorithm: saturation is rounded before multiplying it by 100. That means that it will be always 0 or 1, without any other value.

@CKEditorBot
Copy link
Collaborator

Closed in #4633

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:bug A bug.
Projects
None yet
3 participants