Thread Killer

This post is not invisible.
tenor.gif
 
I'm having code trouble, and I don't know why.
Edit: found out why, now need to figure out a working method to do what I want
 
Last edited:
I figured it out, I was just being stupid, I did everything right, I just needed to put it in a new section that it could run in, as opposed to where I had it, where it would not run because of reasons.
 
@PrivateRiley
So someone else had made this...
temp.gif

it was a little thing on the computer desktop in the game Night In The Woods, which I would highly recommend playing by the way. Anyways, I have a folder full of wallpapers I plan on using in a slideshow once I get a laptop (I only use the one on my desktop) and I wanted it to be able to automatically change from white to black depending on the background. (before, one would have to manually change it)
So, I created a copy of the white version, and made it so that if the luminosity of the image is high enough, it would invert to black.
Now for the more technical explanation
Since there is no sort of invert color function, I had to make it change some variables set up in a color matrix. Their default values would keep everything normal, and their alternate values would make inverted colors. The problem I was talking about was putting the "If statement" in a meter, as opposed to a measure, because it only works in measures, not meters.

(it looks a little like this)

-------------------------Edit: forum being weird and adding text to code box, so here is just plain text.
[InvertCalcP]
Measure=Calc
Formula=P
IfCondition=Chameloen_Luminace > 0.41
IfTrueAction=[!SetVariable P "-1"]
IfFalseAction=[!SetVariable P "1"]

[InvertCalcL]
Measure=Calc
Formula=L
IfCondition=Chameloen_Luminace > 0.41
IfTrueAction=[!SetVariable L "1"]
IfFalseAction=[!SetVariable L "0"]

------------------------- and the inversion

ColorMatrix1=#P#;0;0;0;0
ColorMatrix2=0;#P#;0;0;0
ColorMatrix3=0;0;#P#;0;0
ColorMatrix5=#L#;#L#;#L#;0;1


Code:
[Rainmeter]
Update=100

[Metadata]
Name=Sharkle Chameleon Version
Author=DrunkOnSchadenfreude (Modified by: Obi-Wan_Canole)
Information=Sharkle Chameleon Version
Version=v0.1
License=Creative Commons Attribution-Non-Commercial-Share Alike 3.0
BackgroundMode=1

[Skin]
Draggable=1

[Chameloen_Parent]
Group=ChamColourM
Measure=Plugin
Plugin=Chameleon
OnUpdateAction=[!UpdateMeasure Chameloen_Luminace]

[Chameloen_Luminace]
Group=ChamColour
Measure=Plugin
Plugin=Chameleon
Parent=Chameloen_Parent
Color=Luminance
Format=Dec
UpdateDivider=-1

[Variables]
GreetMax=12
GreetingActive=0
Reset=1
P="1"
L="0"


[GreetCounter]
Measure=Calc
Formula=(GreetCounter+#GreetingActive#)*#Reset#
IfAboveValue=#GreetMax#
IfAboveAction=[!HideMeter SharkleHello][!HideMeter SharkleTalk][!ShowMeter ImageMeter][!SetVariable GreetingActive 0][!SetVariable Reset 0]
DynamicVariables=1

[SoundCounter]
Measure=Calc
Formula=Counter % 8

[ImageNumberCalc]
Measure=Calc
Formula=Counter % 8

[InvertCalcP]
Measure=Calc
Formula=P
IfCondition=Chameloen_Luminace > 0.41
IfTrueAction=[!SetVariable P "-1"]
IfFalseAction=[!SetVariable P "1"]

[InvertCalcL]
Measure=Calc
Formula=L
IfCondition=Chameloen_Luminace > 0.41
IfTrueAction=[!SetVariable L "1"]
IfFalseAction=[!SetVariable L "0"]

[ImageMeter]
Meter=Image
ImageName=#@#/white/sharkle_idle_1_0000[ImageNumberCalc].png
ImageTint
AntiAlias=1
DynamicVariables=1
H=128
W=128
X=80
Y=80
LeftMouseDownAction=[!HideMeter ImageMeter][!ShowMeter SharkleHello][!ShowMeter SharkleTalk][!SetVariable GreetingActive 1][!SetVariable Reset 1][Play "#@#greeting-0[SoundCounter].wav"]
SolidColor=0,0,0,1

ColorMatrix1=#P#;0;0;0;0
ColorMatrix2=0;#P#;0;0;0
ColorMatrix3=0;0;#P#;0;0
ColorMatrix5=#L#;#L#;#L#;0;1

[HelloCalc]
Measure=Calc
Formula=GreetCounter % 4

[SharkleHello]
Meter=Image
ImageName=#@#/white/sharkle_hello_1_0000[HelloCalc].png
AntiAlias=1
DynamicVariables=1
H=128
W=128
X=80
Y=80
Hidden=1
SolidColor=0,0,0,1

ColorMatrix1=#P#;0;0;0;0
ColorMatrix2=0;#P#;0;0;0
ColorMatrix3=0;0;#P#;0;0
ColorMatrix5=#L#;#L#;#L#;0;1

[TalkCalc]
Measure=Calc
Formula=Round(GreetCounter / 3, 0) % 2

[SharkleTalk]
Meter=Image
ImageName=#@#/white/sharkle_talk_sharkle1_0000[TalkCalc].png
AntiAlias=1
DynamicVariables=1
H=128
W=128
Hidden=1
SolidColor=0,0,0,1

ColorMatrix1=#P#;0;0;0;0
ColorMatrix2=0;#P#;0;0;0
ColorMatrix3=0;0;#P#;0;0
ColorMatrix5=#L#;#L#;#L#;0;1


;[Text]
;Meter=String
;DynamicVariables=1


;Text=[Chameloen_Luminace] #P# #L#
;FontColor=255,255,255,255

;left over junk
;IfCondition=Chameloen_Luminace >= 0
;IfTrueAction=[!SetVariable P "-1"][!SetVariable L "1"]
;IfFalseAction=[!SetVariable P "1"][!SetVariable L "0"]
The program that makes it work is Rainmeter https://www.rainmeter.net/
and the extra plugin used (Chameleon) https://software.socksthefox.net/chameleon/
Edit2: I forgot to mention, I hope everyone's having a good Valentine's Day!
 
Last edited:
Back
Top