It is currently February 6th, 2023, 8:17 pm

## Decimal Color in condition

Get help with creating, editing & fixing problems with skins
StArL0rd84
Posts: 400
Joined: February 8th, 2015, 10:07 pm
Location: EU, Denmark.

### Decimal Color in condition

I want to use a conditional calculation to to determine the color of a buttons current state. Normal, Hover and pressed. (1, 2 or 3)

ImageTint=(#ColorButtonState1# = 1 ? 255,0,0 : (#ColorButtonState1# = 2 ? 0,255,0 : 0,0,255)))

Is there any way I can use commas in the calculation? Parentheses? Escaping the commas?
SilverAzide
Rainmeter Sage
Posts: 2250
Joined: March 23rd, 2015, 5:26 pm

### Re: Decimal Color in condition

StArL0rd84 wrote: September 13th, 2022, 3:56 pm I want to use a conditional calculation to to determine the color of a buttons current state. Normal, Hover and pressed. (1, 2 or 3)

ImageTint=(#ColorButtonState1# = 1 ? 255,0,0 : (#ColorButtonState1# = 2 ? 0,255,0 : 0,0,255)))

Is there any way I can use commas in the calculation? Parentheses? Escaping the commas?
I believe you need to do it color by color, not the entire expression. I mean, something like this:

Code: Select all

``````ImageTint=((#ColorButtonState1# = 1) ? 255 : 0),((#ColorButtonState1# = 2) ? 255 : 0),(((#ColorButtonState1# = 1) || (#ColorButtonState1# = 2)) ? 0 : 255)
; or maybe
ImageTint=((#ColorButtonState1# = 1) ? 255 : 0),((#ColorButtonState1# = 2) ? 255 : 0),((#ColorButtonState1# = 3) ? 255 : 0)``````
In other words:
ImageTint=((#ColorButtonState1# = 1) ? 255 : 0),((#ColorButtonState1# = 2) ? 255 : 0),((#ColorButtonState1# = 3) ? 255 : 0)
balala
Rainmeter Sage
Posts: 14940
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

### Re: Decimal Color in condition

StArL0rd84 wrote: September 13th, 2022, 3:56 pm Is there any way I can use commas in the calculation? Parentheses? Escaping the commas?
Right, SilverAzide is perfectly right, because a formula used anywhere in Rainmeter HAS TO BE entirely numeric. No strings allowed in formulas. A color code, even if is composed by three (or four) numbers, is a string in fact. This is why your approach doesn't work and have to use it as described above by SilverAzide.