• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

XF 1.2 HTML Colour from Style in Template

nrep

Well-known member
#1
Is there a way that I can get the HTML colour for a colour set in the admin panel for use within a template?

For example:

"@pageBackground" used in a template will output "rgb(72, 139, 191)", but I need to get "488bbf" instead. It's to use in some ad code that will only accept the HTML style colour.
 

nrep

Well-known member
#3
Thanks, however I've tried using "@pageBackground" in a template - but it gives the colour in RGB style. It's the 6 character HEX colour code I need to use though, so I'm trying to see if there's a way to get that to be output instead.
 
#4
Just putting something like @primaryDarker worked for me as explained there.
That rgb notation is standard HTML too so it should work just fine in most situations.