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

Expose color selection method #3743

Closed
jacekbogdanski opened this issue Dec 18, 2019 · 1 comment · Fixed by #3856
Closed

Expose color selection method #3743

jacekbogdanski opened this issue Dec 18, 2019 · 1 comment · Fixed by #3856
Assignees
Labels
plugin:colorbutton The plugin which probably causes the issue. status:confirmed An issue confirmed by the development team. type:feature A feature request.

Comments

@jacekbogdanski
Copy link
Member

jacekbogdanski commented Dec 18, 2019

Type of report

Feature request

Provide description of the new feature

Color Button plugin has a private function allowing to select a chosen color from the panel block. With the addition of #3727 feature, it makes sense to expose this function, so it's possible to intercept color command and provide custom color choosing scenarios for more advanced features like Spreadsheets. Preferably, exposed API should be straightforward, similar to #3387

var ui = editor.ui.get( 'TextColor' ); // For background color use BGColor instead.
ui.select( function( item ) {
  return item.value === '#fafafa';
} );

Note that this feature should only handle colors from the color button panel as colors from the color dialog are not preserved in UI yet.

@jacekbogdanski jacekbogdanski added type:feature A feature request. status:confirmed An issue confirmed by the development team. plugin:colorbutton The plugin which probably causes the issue. workload:low labels Dec 18, 2019
@jacekbogdanski jacekbogdanski added this to the Planning milestone Dec 18, 2019
@f1ames f1ames modified the milestones: Planning, Next Jan 17, 2020
@jacekbogdanski
Copy link
Member Author

jacekbogdanski commented Feb 3, 2020

Also, it would be good to have some option to select auto color if a color has not been found. It may be the default behavior of the selection method.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
plugin:colorbutton The plugin which probably causes the issue. 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.

2 participants