ckeditor / ckeditor5

Powerful rich text editor framework with a modular architecture, modern integrations, and features like collaborative editing.
https://ckeditor.com/ckeditor-5
Other
9.63k stars 3.71k forks source link

fontColor.colorPicker.format not working? #17106

Open fanggz2017 opened 2 months ago

fanggz2017 commented 2 months ago

I followed the official documentation and configured fontColor.colorPicker.format in my project, but I found that it didn't work. The color output is always in HSL format

ClassicEditor
    .create( document.querySelector( '#editor' ), {
        fontColor: {
            colorPicker: {
                // Use 'hex' format for output instead of 'hsl'.
                format: 'hex' 
            }
        },
        fontBackgroundColor: {
            // Don't display the color picker.
            colorPicker: false
        },
        toolbar: [
            'heading', 'bulletedList', 'numberedList', 'fontColor', 'fontBackgroundColor', 'undo', 'redo'
        ]
    } )
    .then( /* ... */ )
    .catch( /* ... */ );

image image

version: 43.1.0

document: https://ckeditor.com/docs/ckeditor5/latest/features/font.html#color-picker

bosemian commented 1 month ago

I'm get same issue when set fontColor format 'hex'.

Witoso commented 1 month ago

We investigated it a bit, and it turned out we didn't document that the list of predefined colors is not working with the format option. Looks like you need to configure predefined colors in the same format as requested. Would you mind verifying if it works correctly when you pick a custom color?

Predefined colors marked in red: Image

CKEditorBot commented 3 weeks ago

The issue lacks the feedback we asked for two weeks. Hence, we've marked it as stale and will close it in 30 days. We understand it may still be relevant, so if you're interested in the solution, leave a comment or reaction under this issue.

bosemian commented 3 weeks ago

My point just need inline style with hex, because some lib not read hsl format

sidshen111111 commented 5 days ago

I set hex and found that sometimes it outputs hex, and sometimes it outputs hsl