It is currently April 27th, 2024, 5:04 pm

Changing colors and values while keeping data

Get help with creating, editing & fixing problems with skins
happydude11209
Posts: 2
Joined: December 15th, 2012, 5:17 pm

Changing colors and values while keeping data

Post by happydude11209 »

Hello,
I have been making a skin in my free time for a while. It has a bunch of line graphs and scraped data. I have two themes to be able to have better contrast against different backgrounds (the meter background is semi-transparent). One is dark and one is light. Right now i have them stored in two different skins. I have to update both do add stuff and it's getting kinda tedious to do that. I'd like to make it so that it is one skin with both themes in it, both to make updating easier, and because as it is now, switching themes re-scrapes all of the internet data, and resets all of my line meters. The only difference between the two is a few colors, and image file names (bat.png vs bat2.png). I've seen skins with multiple styles that change between them with a middle click, and I think that is done with .incs but I don't know how to use them. So, 1) is it possible to change the color on a line with out that line reseting, 2) could it be done with a .inc and 3) if so is there any good tutorial on using .incs?
Thanks,
Happydude11209
ps, ive attached images of both themes on a neutral grey background (same grey)
You do not have the required permissions to view the files attached to this post.
happydude11209
Posts: 2
Joined: December 15th, 2012, 5:17 pm

Re: Changing colors and values while keeping data

Post by happydude11209 »

I found nice material about .incs here (http://docs.rainmeter.net/tips/include-guide) and here (http://docs.rainmeter.net/manual/skins/include-option) and have implemented them. It seems that there is no way to have the color update without refreshing the skin.
User avatar
MerlinTheRed
Rainmeter Sage
Posts: 889
Joined: September 6th, 2011, 6:34 am

Re: Changing colors and values while keeping data

Post by MerlinTheRed »

I wrote a giant post at first, then saw that you actually know all this aready ;)

You can change colors without include files by just changing the values of the variables you store the color in.

If you already have variables for all the things you want to change, you can switch themes via bangs. Here's how it might look like in a very simplified form:

Code: Select all

[Variables]

; all the variable values for theme 1
Color1=184, 72, 196, 204
Image1=#@#/Images/img1.png

; all the variable values for theme 2
Color2=12, 43, 97, 204
Image2=#@#/Images/img2.png

; variables you are currently using (default when starting up the skin)
Color=184, 72, 196, 204
Image=#@#/Images/img.png


; Button to switch to theme 2
[Theme2Activator]
Meter=Image
X=0
Y=0
W=50
H=50
SolidColor=#Color#
ImageName=#Image#
; it's important to set DynamicVariables=1 on all meters that use one 
; of the theme variables, so you don't have to refresh the skin for the 
; changes to take effect
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Color #Color2#][!SetVariable Image #Image2#][!HideMeter #CURRENTSECTION#][!ShowMeter Theme1Activator]

; Button to switch to theme 1
[Theme1Activator]
Meter=Image
X=0
Y=0
W=50
H=50
SolidColor=#Color#
ImageName=#Image#
DynamicVariables=1
LeftMouseUpAction=[!SetVariable Color #Color1#][!SetVariable Image #Image1#][!HideMeter #CURRENTSECTION#][!ShowMeter Theme2Activator]
Have more fun creating skins with Sublime Text 2 and the Rainmeter Package!