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

Fix for incorrect encoding of RGBA/HSLA colors in color dialog #4591

Merged
merged 17 commits into from
Apr 1, 2021

Conversation

Comandeer
Copy link
Member

What is the purpose of this pull request?

Bug fix

Does your PR contain necessary tests?

All patches that change the editor code must include tests. You can always read more
on PR testing,
how to set the testing environment and
how to create tests
in the official CKEditor documentation.

This PR contains

  • Unit tests
  • Manual tests

Did you follow the CKEditor 4 code style guide?

Your code should follow the guidelines from the CKEditor 4 code style guide which helps keep the entire codebase consistent.

  • PR is consistent with the code style guide

What is the proposed changelog entry for this pull request?

* [#4351](https://github.com/ckeditor/ckeditor4/issues/4351): Fixed: Incorrect values for RGBA/HSLA colors in [Color Dialog](https://ckeditor.com/cke4/addon/colordialog).

What changes did you make?

I've unified functions used for color normalization in colorbutton plugin and added special handling for RGBA and HLSA colors.

Which issues does your PR resolve?

Closes #4351.

@Comandeer
Copy link
Member Author

Rebased onto latest master.

@Dumluregn Dumluregn self-requested a review March 26, 2021 18:08
@Dumluregn Dumluregn self-assigned this Mar 26, 2021
Copy link
Contributor

@Dumluregn Dumluregn left a comment

Choose a reason for hiding this comment

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

Fix is working and tests are passing 👍🏻

I've left mostly some refactoring proposals, please take a look.

plugins/colorbutton/plugin.js Outdated Show resolved Hide resolved
plugins/colorbutton/plugin.js Outdated Show resolved Hide resolved
plugins/colorbutton/plugin.js Outdated Show resolved Hide resolved
tests/plugins/colordialog/_helpers/tools.js Outdated Show resolved Hide resolved
plugins/colorbutton/plugin.js Outdated Show resolved Hide resolved
tests/plugins/colordialog/_helpers/tools.js Outdated Show resolved Hide resolved
tests/plugins/colordialog/colordialog.js Outdated Show resolved Hide resolved
tests/plugins/colordialog/colordialog.js Show resolved Hide resolved
tests/plugins/colordialog/manual/colorconvertion.md Outdated Show resolved Hide resolved
tests/plugins/colordialog/manual/colorconvertion.md Outdated Show resolved Hide resolved
@Comandeer
Copy link
Member Author

Ok, I've fixed all issues with the test and refactored normalization method (by moving it to ColorBox.normalizeColo).

@Comandeer Comandeer requested a review from Dumluregn April 1, 2021 12:07
@Dumluregn Dumluregn self-assigned this Apr 1, 2021
Copy link
Contributor

@Dumluregn Dumluregn left a comment

Choose a reason for hiding this comment

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

Well done 🎉

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.

2 participants