Skip to content

Commit

Permalink
docs: Update for BBCodeColor
Browse files Browse the repository at this point in the history
Remove limitations and extend examples for more color code formats.
  • Loading branch information
mmichaelis committed Oct 12, 2023
1 parent ea90fa8 commit 2053848
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions packages/ckeditor5-bbcode/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,9 +135,10 @@ representation `<s>Text</s>` and will map them back to `[s]` again.

Relying on the HTML5 Preset by [BBob][] the `toView` mapping is as follows:

| Tag | as HTML |
|-------------------|----------------------------------|
| `[color=#ff0000]` | `<span style="color: #ff0000;">` |
| Tag | as HTML |
|---------------------|------------------------------------|
| `[color=#ff0000]` | `<span style="color: #ff0000;">` |
| `[color=#ff0000a0]` | `<span style="color: #ff0000a0;">` |

A possible recommended configuration for the CKEditor 5 font-color feature to
support this, is:
Expand All @@ -151,18 +152,23 @@ fontColor: {
label: "Black",
},
{
color: "#ff0000",
color: "red",
label: "Red",
},
{
color: "rgba(0, 0, 255, 1.0)",
label: "Blue",
},
],
colorPicker: {
format: "hex",
},
},
```

Formats such as HSL, RGB are not supported. With the `documentColors` enabled,
also colors existing in the BBCode are offered for preselection.
Formats such as HSL, RGB are supported in `toData` mapping. They will be
transparently transformed to the corresponding hex/hex-alpha codes suitable
for the `[color]` tag.

### Links

Expand Down

0 comments on commit 2053848

Please sign in to comment.