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?
It is currently March 29th, 2024, 9:38 am
Decimal Color in condition
-
- Posts: 424
- Joined: February 8th, 2015, 10:07 pm
- Location: EU, Denmark.
-
- Rainmeter Sage
- Posts: 2588
- Joined: March 23rd, 2015, 5:26 pm
Re: Decimal Color in condition
I believe you need to do it color by color, not the entire expression. I mean, something like this: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?
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)
ImageTint=((#ColorButtonState1# = 1) ? 255 : 0),((#ColorButtonState1# = 2) ? 255 : 0),((#ColorButtonState1# = 3) ? 255 : 0)
-
- Rainmeter Sage
- Posts: 16110
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Decimal Color in condition
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.StArL0rd84 wrote: ↑September 13th, 2022, 3:56 pm Is there any way I can use commas in the calculation? Parentheses? Escaping the commas?