It is currently April 25th, 2024, 5:57 am

Conditional Images? Is This Possible?

Get help with creating, editing & fixing problems with skins
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Conditional Images? Is This Possible?

Post by Yincognito »

eclectic-tech wrote: March 28th, 2020, 7:11 pmYou have only 1 text item showing [ItemWhat1] and [...]
You lost me at ... ItemWhat ... the heck is going on here, LOL. :jawdrop But I believe you, I swear! :thumbup:
balala wrote: March 28th, 2020, 7:37 pmImageTint=255,(255-255*Clamp(#Item1Title#,0,1)),(255-255*Clamp(#Item1Title#,0,1))
I like this type of approach. I've used it multiple times in my skins as well - I just loooove to do something by the sheer math of a formula. :great:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Conditional Images? Is This Possible?

Post by balala »

Yincognito wrote: March 28th, 2020, 7:52 pm I like this type of approach. I've used it multiple times in my skins as well - I just loooove to do something by the sheer math of a formula. :great:
Yep, as said, I consider this an extremely elegant solution.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 5406
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Conditional Images? Is This Possible?

Post by eclectic-tech »

Yincognito wrote: March 28th, 2020, 7:52 pm You lost me at ... ItemWhat ... the heck is going on here, LOL. :jawdrop But I believe you, I swear! :thumbup:



I like this type of approach. I've used it multiple times in my skins as well - I just loooove to do something by the sheer math of a formula. :great:
What I did was to use the OP's original code, which is a modified Enigma reader skin. In there he has modified it to display only 1 item and wants to change the color of the [Icon] image meter based on the value of that item; #Item1Title#.

Enigma uses themes ('W' or 'B') as the #ColorImage# value to choose those preset color images from @Resources, so ImageTint is the better solution based on the returned value. Actually, if the 'Light' version is used, ImageTint will not work as well since changing the color of a black icon is not as easy.

Yes guys, that option could be used directly in the add ImageTint line; I have done that many times myself to simplify my code.
Knowing both ways may help others decide which method they want to use.
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Conditional Images? Is This Possible?

Post by Yincognito »

eclectic-tech wrote: March 28th, 2020, 10:28 pmWhat I did was to use the OP's original code, which is a modified Enigma reader skin. In there he has modified it to display only 1 item and wants to change the color of the [Icon] image meter based on the value of that item; #Item1Title#.
Ohh, you're right. I couldn't see that ItemWhat1 anywhere when I posted the reply (although it was right there in the quoted message, I realized that now), so please excuse my head lurking in the clouds this time. :D

Anyway, you have to agree that the name just begged for a WT[insert "bad" acronym suffix here] joke on it - and I couldn't help myself... :lol:
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
tjhuntley
Posts: 17
Joined: December 2nd, 2019, 3:10 pm

Re: Conditional Images? Is This Possible?

Post by tjhuntley »

Wow guys, this is a lot of info!! THANK YOU! Sorry I haven't had time to reply. Lockdown started in a town where I have a small business and getting everyone prepared for that was stressful. I am back now and going to try to figure this out and get some answers and HOPEFULLY get this to work. I really wish I knew Rainmeter like I do Google Sheets. But thanks for all you guys taking time to help me on this.
tjhuntley
Posts: 17
Joined: December 2nd, 2019, 3:10 pm

Re: Conditional Images? Is This Possible?

Post by tjhuntley »

Yincognito wrote: March 28th, 2020, 7:52 pm You lost me at ... ItemWhat ... the heck is going on here, LOL. :jawdrop But I believe you, I swear! :thumbup:
I saw this and literally lolled. My gf just looked at me weird. :/
User avatar
Yincognito
Rainmeter Sage
Posts: 7157
Joined: February 27th, 2015, 2:38 pm
Location: Terra Yincognita

Re: Conditional Images? Is This Possible?

Post by Yincognito »

tjhuntley wrote: April 15th, 2020, 4:48 am I saw this and literally lolled. My gf just looked at me weird. :/
That was the whole point of it - we must find ways to have fun even with the problems you mentioned on the horizon. Your girlfriend probably thought "what the ... heck" as well, haha! Just make her laugh as well and you'll be fine. ;-)
Profiles: Rainmeter ProfileDeviantArt ProfileSuites: MYiniMeterSkins: Earth
User avatar
balala
Rainmeter Sage
Posts: 16168
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Conditional Images? Is This Possible?

Post by balala »

tjhuntley wrote: April 15th, 2020, 4:46 am I really wish I knew Rainmeter like I do Google Sheets.
I assure you if you keep working, you will know a lot of things related to Rainmeter. However probably never everything.