Implement Color normalizer #4358
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
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 takesstring
as an argument -> color code.Normalizer should:
colorCode
for different formatsHEX
,RGB
, plain string (eg:red
). Converts to default color (eg. #000) in case of invalid format or non-existing plain-text colorBenefits:
Color
object as argument between functions, instead ofmagic string
with always unknown contentcolor.toHex()
orcolor.toRGBA()
Color normalizer should be provided with
core/tools
or separate class.For more context of this feature, please look at comments at #4333
The text was updated successfully, but these errors were encountered: