Style template colours not working

I created a template to be able to use more than the standard colours. I have created this template:

But when I try to use the colours, they do not work. I try to use them in a change node as per screenshot. I have tried using --color-blue-2 as well as just blue-2, it does not work. If I use the standard colours (red, blue green etc) it does work, but its not using the rgb specified in my template, so just using the standard colours I think. If I use --color-blue-2 it seems to use a blue, but nor whats in the template. Changing the rgb values to a red (255,0,0) for example, its still showing as blue.

NR color

Have you tried with HEX values for colors?

I hadnt, but I just tried and its not working.

I put this in the styele template

--color-blue-2: #eeeeee; instead of --color-blue-2: (255, 0, 0);

Well it of course depends how you use those CSS variables. You haven't showed that part yet.

Is that what you mean by how you use the CSS variables ?

I use them in a dashboard text node like this:

with the change node from my first post linked to it

Ok. This way you can't use the CSS variables.
But I did some tests, and what is interesting, whatever the "msg.color" is, the browser tries to figure out some color from it. and if you use some known named color, it actually does the trick.
Known that <font > tag is actually deprecated but of course the deprecation for browsers world does not mean that it is not working anymore and would fire some errors. It works but you can't tell how and why ...

So if you want to keep the thing working like it is, do use known named colors. Otherwise it will be quite of different approach.

Ok that makes sense, at least I understand why its not working.
But, as I really would like more colours (where do I find a list of 'known' colours ?) how could I achieve that ? I have a lot of text and other nodes where I'd like to be able to set different colours, and I dont think there are lets say 3 or 4 different blues, reds, greens etc in the known colours ?

It says modern browsers support 140. It does not say that the deprecated <font> tag is capable. But you can try. :slight_smile:

Nice one. I think 140 colours is plenty. And I just tried a few random ones. They work !!! Now All I have to do is assign them and change some programming to make my dashboard better.

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.