-
Notifications
You must be signed in to change notification settings - Fork 2.5k
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
Color history incorrectly displays colors entered as name or in RGB format #4333
Comments
I'm not sure if we should just take care of Maybe we should validate input for common standards ( If there is no match - there is no color change after |
Well, there are at least two cases here - one related to the mechanism which assumes that all colors inserted in color dialog are in HEX format (thus starting with The other case is related to
I guess you may be looking into |
Solving this as @Dumluregn
That was definitely that problem - Thanks. |
We could create
Benefits:
It's similar to @jacekbogdanski idea at #4351 Maybe it's worth doing as a common solution for both issues? |
I don't mind cleaning this mess. @sculpt0r proposition about separate
Because we are in LTS support, so no breaking changes allowed (although we could deprecate some methods). Besides, we will still probably have to keep it in The question is if we want to spend significant time on this refactoring for a fairly simple bug fix. |
Looks like I mixed up the different issue with this one - #4351 😄 So, yeah the proposition looks good, but:
I agree with that and your proposition should rather be implemented in #4351 The issue is probably caused by a hardcoded hash in ckeditor4/plugins/colorbutton/plugin.js Line 524 in 345756a
So, moving the correct color hash composition outside the template should be enough to fix it, right? In that case, it doesn't make sense going with such big refactoring, since it will be rather available via a major release. I would be for extracting it into a separate issue if we are able to fix this bug in a couple lines of code. |
Ok, I've mixed it up again, is it Monday or something? I'm still writing about #4351 where we have prefixed hash character, not removed when it doesn't exist. I suppose the issue happens somewhere during hex normalization, so it should be still easy to fix. It would be good to check if #4351 hash prefix for rgba/hsla is caused by invalid conversion or some magic with |
@jacekbogdanski was first with his #4333 (comment), but it seems we mostly agree 👍 (yeah, not after his two next comments 🙈)
Yes, no breaking changes (unless we have a very good reason which is almost never 😄), but deprecating stuff is acceptable.
Keeping it there will be the simplest option (especially that we can't move existing function to not cause breaking changes - but we can somehow proxy new ones to have backwards compatibility). But adding new file is not difficult, since it's enough to add it to loader class. So that's an option too and since everything is minified and concat I don't see a reason not to extract it. So unifying/normalizing colors generally seems like a good idea to keep the code simpler (by extracting colors handling logic). After looking into
So I'm for extracting colors logic, so we can cover above issues (including #4351) at once, but @sculpt0r please try the KISS approach to really focus on solving the above issues. And as we already have some conversion/normalization color functions in tools ( And it will be good to extract separate issue here for Introducing color normalization tools. WDYT @jacekbogdanski @sculpt0r? As a side not, the colors in the content itself (e.g. |
After F2F talk with @jacekbogdanski and @sculpt0r we decide to go with "proper" solution, proposed initially by @sculpt0r and described also in #4333 (comment) - so introducing tool for color normalization. Such approach will help us to fix all issues mentioned above without making already convoluted color handling logic even more complex. |
Ok, so basically it seems that trying to fix this issue equal de facto unifying the whole color handling flow, as any change to |
Blocked on #4592 as trying to fix this issue requires a vast refactoring of how colors are passed between specific parts of the editor. |
We had started working on the PR to cover this issue but decided to postpone it due to #4718 (comment). |
Type of report
Bug
Provide detailed reproduction steps (if any)
red
in the input and clickOk
.Expected result
There is a red color box.
Actual result
Color box is transparent - it's color is
ED
.Other details
The same problem occurs if you type a color in the
RGB
format. The reason is color history assumes the first character in color name will be a#
and removes it - no questions asked.4.15.0
and color history feature (Preserving custom colors feature #1795)colordialog
The text was updated successfully, but these errors were encountered: