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

Implement Color normalizer #4358

Closed
sculpt0r opened this issue Nov 4, 2020 · 1 comment · Fixed by #4366
Closed

Implement Color normalizer #4358

sculpt0r opened this issue Nov 4, 2020 · 1 comment · Fixed by #4366
Assignees
Labels
changelog:api A changelog entry should be put in the API section of the changelog. core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:task Any other issue (refactoring, typo fix, etc).
Milestone

Comments

@sculpt0r
Copy link
Contributor

sculpt0r commented Nov 4, 2020

Type of report

Feature request

Provide description of the new feature

What is the expected behavior of the proposed feature?

Create separate class Color (aka color normalizer). Constructor takes string as an argument -> color code.
Normalizer should:

  • verify colorCode for different formats HEX, RGB, plain string (eg: red). Converts to default color (eg. #000) in case of invalid format or non-existing plain-text color
  • provide interface to get any format from input data

Benefits:

  • use Color object as argument between functions, instead of magic string with always unknown content
  • whenever need color string (for CSS etc) - we use explicit format like: color.toHex() or color.toRGBA()
  • conversions should be quite comfortable for unit tests

Color normalizer should be provided with core/tools or separate class.

For more context of this feature, please look at comments at #4333

@sculpt0r sculpt0r added type:feature A feature request. status:confirmed An issue confirmed by the development team. core The issue is caused by the editor core code. size:M labels Nov 4, 2020
@f1ames f1ames assigned f1ames and sculpt0r and unassigned f1ames Nov 6, 2020
@f1ames f1ames added size:S and removed size:M labels Dec 7, 2020
@CKEditorBot
Copy link
Collaborator

Closed in #4366

@CKEditorBot CKEditorBot added this to the 4.16.0 milestone Dec 15, 2020
@f1ames f1ames added changelog:api A changelog entry should be put in the API section of the changelog. type:task Any other issue (refactoring, typo fix, etc). and removed type:feature A feature request. labels Dec 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
changelog:api A changelog entry should be put in the API section of the changelog. core The issue is caused by the editor core code. status:confirmed An issue confirmed by the development team. type:task Any other issue (refactoring, typo fix, etc).
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants