quill icon indicating copy to clipboard operation
quill copied to clipboard

custom font color

Open leo-zhao opened this issue 12 years ago • 7 comments

Does quill have the ability to do custom font colors rather from the color palette, eg rgb color picker?

leo-zhao avatar Aug 20 '14 02:08 leo-zhao

Yes it can set text to arbitrary colors. The ones used in the demos are just examples. Feel free to change the value attribute on an option tag to whatever color you want if you are using the toolbar module or just specify whatever color you want through the API if you are using formatText.

jhchen avatar Aug 20 '14 03:08 jhchen

Hey @jhchen,

Is there any help on how to do this ? has anyone made an arbitrary color picker for Quill.

I am just about to give it a go so any help would be great

tylerkrett avatar Sep 22 '17 15:09 tylerkrett

@tylerkrett did you have any luck with this? I'm about to do the same

simonwilbert avatar Nov 07 '17 11:11 simonwilbert

@simonwilbert I got very close to implementing it but the main flaw i was having was setting the colours picked to a board to be reused. I did not see a light at end of the tunnel and I did not implement arbitrary colour picker for Quill and do not try Draft-js you will have the same outcome.

so in the end I used Tiny-MCE but remember that tiny-mce support for react is not up to date so you can use my repo that is to get you going

npm repo: react-tinymce-rebelfish

tylerkrett avatar Nov 23 '17 10:11 tylerkrett

Custom colors have worked out of the box as described by the documentation since a very early version of Quill.

Via the API, formatText just works. You an try it out by going to https://quilljs.com, opening the developer console and trying quill.formatText(0, 10, 'color', '#abc123');

Via a custom toolbar, you can just change the toolbar setting to { color: ['#abc123'] } like in this example. The configuration details for the toolbar can be found here.

jhchen avatar Jan 22 '18 08:01 jhchen

how to make the toolbar accept text to arbitrary color rather than predefined color?

lili21 avatar Nov 12 '20 04:11 lili21

I tried the solution, it doesn't change line color under the A button

lili21 avatar Nov 12 '20 04:11 lili21