It is currently March 29th, 2024, 9:46 am

Hello everyone, new here. Also got a question about smooth transitions

Introduce yourself to the Rainmeter community!
zen.sushi
Posts: 3
Joined: January 13th, 2021, 2:58 am

Hello everyone, new here. Also got a question about smooth transitions

Post by zen.sushi »

Hello,
I have been used Rainmeter for years now and have recently got into creating my own skins.
I have only made a few ram/CPU bars and angles till now. and I wanted to try out something new.

So my idea is to have the shadow color (which I am using as a glow) of my string meter have a breathing effect, in other words smooth alpha transition of the color parameter in the inlinesetting of the string - for example from 0 to 200 to back to 0 over the span of 2 seconds and repeat. But I'm unsure of how to go about it. I think there needs to be some lua scripting involved, especially to smoothen the transition - perhaps someone can point at something for me to look at?
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hello everyone, new here. Also got a question about smooth transitions

Post by balala »

zen.sushi wrote: February 2nd, 2021, 4:06 pm Hello,
I have been used Rainmeter for years now and have recently got into creating my own skins.
I have only made a few ram/CPU bars and angles till now. and I wanted to try out something new.
Hi and welcome aboard. This is how we all have started.
zen.sushi wrote: February 2nd, 2021, 4:06 pm So my idea is to have the shadow color (which I am using as a glow) of my string meter have a breathing effect, in other words smooth alpha transition of the color parameter in the inlinesetting of the string - for example from 0 to 200 to back to 0 over the span of 2 seconds and repeat. But I'm unsure of how to go about it. I think there needs to be some lua scripting involved, especially to smoothen the transition - perhaps someone can point at something for me to look at?
Would you like a dynamically changing shadow effect on a string meter, within two seconds, then repeat this? Did I understand well your intention?
zen.sushi
Posts: 3
Joined: January 13th, 2021, 2:58 am

Re: Hello everyone, new here. Also got a question about smooth transitions

Post by zen.sushi »

balala wrote: February 2nd, 2021, 4:29 pm Would you like a dynamically changing shadow effect on a string meter, within two seconds, then repeat this? Did I understand well your intention?
Yes, exactly that just on the shadow color variable. But smoothened, not jumping between 0 and 200 alpha.
User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hello everyone, new here. Also got a question about smooth transitions

Post by balala »

zen.sushi wrote: February 2nd, 2021, 4:37 pm Yes, exactly that just on the shadow color variable. But smoothened, not jumping between 0 and 200 alpha.
There are more possible solutions, here is one of them:

Code: Select all

[Rainmeter]
Update=100

[MeasureColor]
Measure=Calc
Formula=( COUNTER % 30 )

[MeasureRed]
Measure=Calc
Formula=((8.5*MeasureColor)%256)

[MeasureGreen]
Measure=Calc
Formula=((12.5*MeasureColor)%256)

[MeasureBlue]
Measure=Calc
Formula=((10.5*MeasureColor)%256)

[MeterResult]
Meter=STRING
X=0
Y=0
FontColor=220,220,220
FontSize=40
Text=My string
InlineSetting=Shadow | 8 | 8 | 3.5 | (255*Sin(Rad(360*[MeasureColor]/30))),(255*Sin(Rad(180*[MeasureColor]/30))),(255*Sin(Rad(720*[MeasureColor]/30)))
StringStyle=Bold
DynamicVariables=1
GIF.gif
Obviously the code can be improved, this is just a quickly wrote example.
You do not have the required permissions to view the files attached to this post.
zen.sushi
Posts: 3
Joined: January 13th, 2021, 2:58 am

Re: Hello everyone, new here. Also got a question about smooth transitions

Post by zen.sushi »

WOW, I think I understand the basics of it, too. This is what I made. Thank you sir!

Code: Select all

[Rainmeter]
Update=100
AccurateText=1

[Variables]
TimeSize=60

ColFill=15,5,5,255
ColBlur=255,25,25

;TimeFont=Papyrus
TimeFont=Blackadder ITC
slope=0
TextSpacing=-0.5

bluramt=5
texttopix=(1.2*#TimeSize#)

C_sizeX=((#texttopix#*4)+(2*#bluramt#))
C_sizeY=((#texttopix#*1.5)+(2*#bluramt#))

[MeasureColor]
Measure=Calc
Formula=( COUNTER % 50)

[MeasureTime]
Measure=Time
;Format="%I:%M:%S %p"
Format="%H:%M:%S"


[Background]
Meter=IMAGE
SolidColor=200,150,150,1
X=0
Y=0
W=#C_sizeX#
H=#C_sizeY#



[MeterTime]
MeasureName=MeasureTime
Meter=STRING
X=(#C_sizeX#/2)
Y=((#C_sizeY#/2)-(8))
FontColor=#ColFill#
FontSize=(#TimeSize#)
FontFace=#TimeFont#
StringAlign=CenterCenter
FontWeight=50
AntiAlias=1
InLineSetting=Case | Lower
InlineSetting2=CharacterSpacing | #TextSpacing# | #TextSpacing#
InLineSetting3=Shadow | 0 | 0 | #bluramt# | #ColBlur#,(200*Sin(Rad(180*[MeasureColor]/50)))
DynamicVariables=1

User avatar
balala
Rainmeter Sage
Posts: 16110
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Hello everyone, new here. Also got a question about smooth transitions

Post by balala »

zen.sushi wrote: February 3rd, 2021, 4:10 pm WOW, I think I understand the basics of it, too. This is what I made. Thank you sir!
You're welcome. I see you indeed got the idea.