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

Ability to get the short hex from CKEDITOR.tools.color instance #4726

Open
Comandeer opened this issue May 24, 2021 · 1 comment
Open

Ability to get the short hex from CKEDITOR.tools.color instance #4726

Comandeer opened this issue May 24, 2021 · 1 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:feature A feature request.

Comments

@Comandeer
Copy link
Member

Type of report

Feature request

Provide description of the new feature

Currently CKEDITOR.tools.color#getHex() does not allow getting short version of hex.

We can introduce shorten parameter that would indicate that the short hex is wanted, e.g.

var color = new CKEDITOR.tools.color( '#000000' );

console.log( color.getHex( true ) ); // '#000'

In case of the non-shortenable hexes, it should return the full hex:

var color = new CKEDITOR.tools.color( '#CDAB65' );

console.log( color.getHex( true ) ); // '#CDAB65'

It should be also introduced for CKEDITOR.tools.color#getHexWithAlpha().

@Comandeer Comandeer added type:feature A feature request. status:confirmed An issue confirmed by the development team. 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. size:XXS labels May 24, 2021
@Comandeer Comandeer self-assigned this May 24, 2021
@Comandeer Comandeer mentioned this issue May 24, 2021
3 tasks
@f1ames
Copy link
Contributor

f1ames commented Jun 9, 2021

We had started working on the PR to cover this issue but decided to postpone it due to #4718 (comment).

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:feature A feature request.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants