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

Specific hex values picked via the color picker change to a different value #16411

Open
mabryl opened this issue May 23, 2024 · 1 comment
Open
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:ui squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.

Comments

@mabryl
Copy link
Contributor

mabryl commented May 23, 2024

📝 Provide detailed reproduction steps (if any)

  1. Open the color picker and specify 006EB7 as the value
  2. Accept the value and close the color picker
  3. Select the content that you applied the color to and open the color picker again

✔️ Expected result

The color value should stay the same.

❌ Actual result

The color value changes to 006EB8:

Screen.Recording.2024-05-23.at.16.03.04.mov

❓ Possible solution

This was brought to our attention by one of our clients. Here's what they had to say about the bug:

The underlying cause is that CKEditor stores the color as HSL and rounds the individual HSL values. Specifically, #006EB7 converts to hsl(203.93, 100%, 35.88%), which is then rounded to hsl(204, 100%, 36), resulting in the hex value #006EB8.

📃 Other details

  • Browser: cross-browser
  • OS: cross-OS
  • First affected CKEditor version: N/A
  • Installed CKEditor plugins: something that uses the color picker

If you'd like to see this fixed sooner, add a 👍 reaction to this post.

@mabryl mabryl added type:bug This issue reports a buggy (incorrect) behavior. package:ui domain:ui/ux This issue reports a problem related to UI or UX. support:2 An issue reported by a commercially licensed client. squad:core Issue to be handled by the Core team. labels May 23, 2024
@mabryl
Copy link
Contributor Author

mabryl commented May 23, 2024

Quick heads up that this is easily fixable via config.fontColor.colorPicker.format. The following config for the color picker will make the issue go away:

colorPicker: {
  // Use 'hex' format for output instead of 'hsl'.
  format: 'hex'
}

More info on this behavior can be found in our documentation.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
domain:ui/ux This issue reports a problem related to UI or UX. package:ui squad:core Issue to be handled by the Core team. support:2 An issue reported by a commercially licensed client. type:bug This issue reports a buggy (incorrect) behavior.
Projects
None yet
Development

No branches or pull requests

1 participant