Color indicator in AdminCP does not respond to nested LESS color operations.

ShikiSuen

Well-known member
For example, changing the page chrome color to spin(darken(desaturate(@xf-paletteColor5, 39.62%), 11.37%), 6.91) will result in a question mark instead:
1589332553958.png

P.S.: I am simplifying the color palletes in my style, hence using nested color operations towards XF2 default pallete.
 
Upvote 0

Chris D

XenForo developer
Staff member
We only aim to support a whitelist of Less functions via our colour palette so in some cases this will be expected. Specifically we only support:

JavaScript:
(xf-diminish|xf-intensify|lighten|darken|fade)

Any additional functions that we would like to support in the colour palette JavaScript we have to specifically write the correct code to calculate that colour.

We're not against doing this, but it is currently working as designed so we'd have to consider it for inclusion in the future.
 

ShikiSuen

Well-known member
We only aim to support a whitelist of Less functions via our colour palette so in some cases this will be expected. Specifically we only support:

JavaScript:
(xf-diminish|xf-intensify|lighten|darken|fade)

Any additional functions that we would like to support in the colour palette JavaScript we have to specifically write the correct code to calculate that colour.

We're not against doing this, but it is currently working as designed so we'd have to consider it for inclusion in the future.

Thanks for your response. Looks like I still have to tune the hue wheel of the default palette.

In future XF releases, will there be a function in AdminCP to batch-change the hue of primary / accent color group?
(plus support the real-time display of HSL / HSV colors in the color indicator.)

Also, additional 15 blank color palette slots may help for scratch purposes.
 

ShikiSuen

Well-known member
We only aim to support a whitelist of Less functions via our colour palette so in some cases this will be expected. Specifically we only support:

JavaScript:
(xf-diminish|xf-intensify|lighten|darken|fade)

Any additional functions that we would like to support in the colour palette JavaScript we have to specifically write the correct code to calculate that colour.

We're not against doing this, but it is currently working as designed so we'd have to consider it for inclusion in the future.
Even if I only use your given functions, looks like the nested function is still not supported in the color palette.
for example:
set @xf-chromeBg as #0077ff;
lighten(xf-intensify(@xf-chromeBg, 46%), 92%)
 

Chris D

XenForo developer
Staff member
Nested functions do generally work, but there is a specific scenario where you use one of the xf- functions in the middle that it falls over. I've changed that for the next release.
 
Top