ElkArte Community

Project Support => Support => Topic started by: Mrs. Chaos on January 25, 2022, 12:16:01 pm

Title: How to change the default font colors?
Post by: Mrs. Chaos on January 25, 2022, 12:16:01 pm
Me again.
I would like to add a new color to the color picker when selecting the font color for a new post, and want to change two old colors slightly.
Where can I do this (theme BeSocial)?  I can't find the right pages again. Only here I could find a line with the names of the current colors (line 81):

themes/default/GenericControls.template.php

Title: Re: How to change the default font colors?
Post by: Spuds on January 28, 2022, 10:17:38 am
Those are defined in the GenericControls.template.php in your theme directory (or the default theme directory if you do not have a custom one).  In that file (line 80 for me) you will see
Code: [Select]
					colors: "black,red,yellow,pink,green,orange,purple,blue,beige,brown,teal,navy,maroon,limegreen,white",
If I recall, you can change/remove those to whatever you want as long as they are HTML defined color names.  So you should be able to use any of the CSS1/2/3 names as seen here: https://developer.mozilla.org/en-US/docs/Web/CSS/color_value
Title: Re: How to change the default font colors?
Post by: Mrs. Chaos on January 28, 2022, 01:36:17 pm
Thank you for the explanation.
I had thought that somewhere I also have to change or enter hex codes of the colors, such as this: #0066CC
Title: Re: How to change the default font colors?
Post by: Spuds on January 28, 2022, 06:05:37 pm
Not the editor colors.  Those will simply be rendered as,, for example,<span style="color: darkred;" class="bbc_color">test</span> So simply a named color CSS value that the browser needs to know. 

Now the user can use hexcodes, or RGB values, etc in the BBC color tag,, but the editor is set to only use named colors (at least as far as I know, meaning that is all I've ever tried)
Title: Re: How to change the default font colors?
Post by: Arantor on January 30, 2022, 05:22:27 am
Is that SCEditor you’re using? You should be able to feed it hexcodes with a # in front.
Title: Re: How to change the default font colors?
Post by: Mrs. Chaos on January 31, 2022, 05:12:40 am
No, it's the standard/default editor of Elkarte.
But I'll have a closer look at the SCEditor now. :)
Title: Re: How to change the default font colors?
Post by: Arantor on January 31, 2022, 06:48:37 am
Yes, that’s a component called SCEditor. It does support passing in colours since I did this on my forum, I made a space in the admin where the colour and font options in the editor could be set.