Define new colors for [color]
#1
So my users could type, for example,
[color=cien]text[/color]
instead of
[color=#996633]text[/color]
I don't even know how to go about doing this.
Reply
#2
That already works, you just spelled cyan wrong.
No longer involved in the MyBB project.
Reply
#3
(2023-08-21, 10:24 PM)Nathan Malcolm Wrote: That already works, you just spelled cyan wrong.

I was not trying to spell cyan. I want do define new colors.
Reply
#4
(2023-08-20, 11:44 AM)ArtemidaForum Wrote: So my users could type, for example,
[color=cien]text[/color]
instead of
[color=#996633]text[/color]
I don't even know how to go about doing this.

I haven't checked but couldn't something like this work?

<span class="cien">text</span>

and in the global css for the theme add

.cien {
  color: #996633;
}

You would need to add the css for each 'word' you wanted!
Reply
#5
You can define custom color names with some hex codes in css or you can define it in the MyCode editor, separate BB code for each color.

Example:

regexp:
Quote:\[cien\](.*?)\[/cien\]

replacement:
Quote:<span style="color:#996633">$1</span>

So your users have just to type in the post:
Quote:[cien]Cuckoo[/cien]

But firstly they have to know the names of the custom colors that you added and  to understand the match between the names and the colors.
Reply


Forum Jump:


Users browsing this thread: 1 Guest(s)