Discourse Coloured Text

AI-generated summary

The discussion is about the Discourse Coloured Text theme component, which allows users to color text in posts. merefield introduced the component, citing it as a simple alternative to the BBCode coloring plugin. The component adds a palette icon to the Composer, allowing users to easily color text by selecting a word or phrase, clicking the palette control, and replacing the # symbols with HTML-compatible color names.

Some users, such as rahim123 and kainos, reported issues with the component, including the color UI button title not applying properly and the button not appearing at all. Moin clarified that the component needs to be installed on the site for the button to appear, and provided a link to the install guide.

merefield fixed some issues, and Moin provided additional guidance on installation. Later, Frully and CocoQuark reported a bug where clicking the palette button without selecting text inserts a translation descriptor instead of default text. merefield fixed this issue and added settings for default colors.

The discussion concludes with nathank praising the component and suggesting it could be combined with another theme component to create a single, super-awesome BBCode component.

“BBCode-lite” without the need to install a plugin …

Adds a simple control (palette icon) to the Composer to facilitate colouring of the foreground and background of text

  • Select a word or text
  • Hit the palette control
  • It will be wrapped like so: [wrap=color color=# bgcolor=#]word[/wrap]
  • Replace the #s with html-compatible colour names, e.g. “red”, “grey” … experiment.

:biohazard: NB Same caveats apply as to BBCode: can be used to hide text.

Credits

18 Likes

Thanks a ton for this useful little component.
It doesn’t seem to be applying the composer.color_ui_button_title properly, both when left at the default or when customized:

1 Like

Hello there. I don t have color text button like on this foto. Here I don t see too.

This Customization > Theme component is not installed here. That is why the button does not appear.
Did you add it to your site?

If I knew how to add a plugin it would be good.

I’ve fixed this.

1 Like

There is a guide how to Installing a theme or theme component
All the information is part of the table in the first post

3 Likes

Thanks very much!

1 Like

Excellent component!

Bug report: If I click the palette button with no text selected, it inserts the translation descriptor instead of the ‘default text’:

[en_GB.composer.color_ui_default_text]
isn’t found in the site text customization menu, and isn’t on the component settings page.

2 Likes

Clicking the palette icon without having text selected output this:

[wrap=color color=# bgcolor=#][en.composer.color_ui_default_text][/wrap]

Is this a missing string?

3 Likes

that’s a nasty issue, fixed:

https://github.com/merefield/discourse-tc-coloured-text/commit/b2e7f1496b3f261ceb8d9916331fe0a435469f16

thanks for the reports @Frully @Canapin

I’ve added settings for default colours.

5 Likes

I didn’t even read the last message :facepalm:

3 Likes

Awesome work @merefield! This has been a sorely missing feature - until now!

I wonder if this could be combined with this TC to have a single super-awesome BBCode TC:

4 Likes