Quantcast
Channel: Rainmeter Forums
Viewing all articles
Browse latest Browse all 895

Help: Rainmeter Skins • Re: Adding additional color gradient effects to text

$
0
0
Your code sets the transition colors based on the hour of the day, but it is easier to control those transition colors directly in the action timer actions to set the colors from RED to AM/PM colors.

To accomplish this, I would suggest using a second Time measure monitoring seconds. By setting the action timer "wait" to result in a 3-second change, you use modulo of 12 and take the 2 transition changes every 6 seconds to transition the colors back and forth every 3 seconds.

Code:

; Between 06:00–17:59 (AM), the color cycles and gradients (3s) 255,255,255 ⇄ 255,0,0 (3s); Outside 06:00–17:59 (PM), the color cycles and gradients (3s) 30,30,30 ⇄ 255,0,0 (3s)[Rainmeter]Update=1000[Variables]W=300N=11ColorStep=25Color_R=255Color_G=0Color_B=0[Hello]Meter=STRINGText=HelloX=46Y=46FontColor=#Color_R#,#Color_G#,#Color_B#FontSize=23AntiAlias=1DynamicVariables=1FontFace=AntipastoStringStyle=Bold[ActionTimer]Measure=PluginPlugin=ActionTimerGroup=FadersDynamicVariables=1ActionList1=Repeat ColorPMUpCycle, #W#, #N#ActionList2=Repeat ColorPMDnCycle, #W#, #N#ActionList3=Repeat ColorAMUpCycle, #W#, #N#ActionList4=Repeat ColorAMDnCycle, #W#, #N#ColorPMUpCycle=[!SetVariable Color_R "(Clamp(#Color_R#-#ColorStep#,30,255))"][!SetVariable Color_G "(Clamp(#Color_G#+3,0,30))"][!SetVariable Color_B "(Clamp(#Color_B#+3,0,30))"][!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]ColorPMDnCycle=[!SetVariable Color_R "(Clamp(#Color_R#+#ColorStep#,30,255))"][!SetVariable Color_G "(Clamp(#Color_G#-3,0,30))"][!SetVariable Color_B "(Clamp(#Color_B#-3,0,30))"][!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]ColorAMUpCycle=[!SetVariable Color_R "255"][!SetVariable Color_G "(Clamp(#Color_G#+#ColorStep#,0,255))"][!SetVariable Color_B "(Clamp(#Color_B#+#ColorStep#,0,255))"][!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw]ColorAMDnCycle=[!SetVariable Color_R "255"][!SetVariable Color_G "(Clamp(#Color_G#-#ColorStep#,0,255))"][!SetVariable Color_B "(Clamp(#Color_B#-#ColorStep#,0,255))"][!UpdateMeasureGroup Faders][!UpdateMeterGroup Faders][!Redraw][Time]; Test by uncommenting the calc measure and setting the formula to an hour value; Measure=Calc; Formula=13Measure=TimeFormat=%H[TimeSeconds]Measure=TimeFormat=%SIfCondition=((TimeSeconds%12=6)&&((Time<6)||(Time>=18)))IfTrueAction=[!CommandMeasure ActionTimer "Execute 1"]IfCondition2=((TimeSeconds%12=0)&&((Time<6)||(Time>=18)))IfTrueAction2=[!CommandMeasure ActionTimer "Execute 2"]IfCondition3=((TimeSeconds%12=6)&&((Time>=6)&&(Time<18)))IfTrueAction3=[!CommandMeasure ActionTimer "Execute 3"]IfCondition4=((TimeSeconds%12=0)&&((Time>=6)&&(Time<18)))IfTrueAction4=[!CommandMeasure ActionTimer "Execute 4"]
Note you do not need a fast skin update, Update=1000 works. Also using the CLAMP () function works better for me instead of MIN () in Action Timer where the steps and repeat numbers can result in inaccurate transitions.
hello.gif

Statistics: Posted by eclectic-tech — Today, 2:52 am



Viewing all articles
Browse latest Browse all 895

Trending Articles