It is currently March 28th, 2024, 1:30 pm

Gradients not applying to shape

Get help with creating, editing & fixing problems with skins
Post Reply
hpgbproductions
Posts: 10
Joined: June 12th, 2018, 7:18 am

Gradients not applying to shape

Post by hpgbproductions »

I'm made a dynamic Path-based visualizer skin and would like to fill the inside with a gradient, but gradients won't show.

Code: Select all

[Rainmeter]
Update=32

[Variables]
c=d1fbff
n=,125,125
e=,240,240
t=0.1

.
. (visualizer code)
.

[MASTER]
Meter=Shape
Shape=Path MyPath | StrokeWidth 5 | Stroke Color #c# | Fill RadialGradient MyGradient | StrokeLineJoin Round
MyPath=#c0# | #c1# | #c2# | #c3# | #c4# | #c5# | #c6# | #c7# | #c8# | #c9# | #c10# | #c11# | #c12# | #c13# | #c14# | #c15# | #c16# | #c17# | #c18# | #c19# | #c20# | #c21# | #c22# | #c23# | #c24# | #c25# | #c26# | #c27# | #c28# | #c29# | #c30# | #c31# | #c32# | #c33# | #c34# | #c35# | #c36#
MyGradient=0,0 | #c#1f ; 0.0 | #c#3f ; 1.0
DynamicVariables=1
Log can still detect if the gradient has invalid parameters, so it can't be an issue with reading the line. Any help would be appreciated!
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gradients not applying to shape

Post by jsmorley »

Try closing the path.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gradients not applying to shape

Post by jsmorley »

No idea what you are getting. I can't even begin to test the code you posted.
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradients not applying to shape

Post by balala »

jsmorley wrote: February 27th, 2019, 2:57 pm No idea what you are getting. I can't even begin to test the code you posted.
Yeah, a complete code would be much better, because there are a lot of unknown variables (like c0, c1 and so on).
In addition: Update=32? Is a such small value needed?
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gradients not applying to shape

Post by jsmorley »

balala wrote: February 27th, 2019, 3:01 pm Yeah, a complete code would be much better, because there are a lot of unknown variables (like c0, c1 and so on).
In addition: Update=32? Is a such small value needed?
For a visualizer using AudioLevel? Yes, I'd say it probably is.
User avatar
jsmorley
Developer
Posts: 22628
Joined: April 19th, 2009, 11:02 pm
Location: Fort Hunt, Virginia, USA

Re: Gradients not applying to shape

Post by jsmorley »

The best I can do is assure you that gradients do work fine in Path shapes.

Code: Select all

[MeterShape]
Meter=Shape
X=5
Y=5
Shape=Path MyPath | StrokeWidth 5 | Stroke Color 255,255,255,255 | Fill RadialGradient MyGradient
MyPath=0,0 | LineTo 300,0 | Lineto 300,100 | LineTo 0,100
MyGradient=0,0 | 255,255,255,255 ; 0.0 | 255,255,255,90 ; 1.0

1.jpg
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradients not applying to shape

Post by balala »

jsmorley wrote: February 27th, 2019, 3:02 pm For a visualizer using AudioLevel? Yes, I'd say it probably is.
Yep, if it belongs to a visualizer skin. Does it?
hpgbproductions
Posts: 10
Joined: June 12th, 2018, 7:18 am

Re: Gradients not applying to shape

Post by hpgbproductions »

I fixed the issue, Rainmeter can't detect the center of the path shape if the gradient is called directly from it. I combined the path with another shape with the same settings.

Code: Select all

[MASTER]
Meter=Shape
Shape=Path MyPath | StrokeWidth 5 | Stroke Color #c# | Fill RadialGradient MyGradient | StrokeLineJoin Round
MyPath=#c0# | #c1# | #c2# | #c3# | #c4# | #c5# | #c6# | #c7# | #c8# | #c9# | #c10# | #c11# | #c12# | #c13# | #c14# | #c15# | #c16# | #c17# | #c18# | #c19# | #c20# | #c21# | #c22# | #c23# | #c24# | #c25# | #c26# | #c27# | #c28# | #c29# | #c30# | #c31# | #c32# | #c33# | #c34# | #c35# | #c36#
MyGradient=0,0 | #c#1f ; 0.0 |  #c#1f 0.6 | #c#3f ; 1.0
Shape2=Ellipse 250,250,240,240 | StrokeWidth 5 | Stroke Color #c# | Fill RadialGradient MyGradient | StrokeLineJoin Round
Shape3=Combine Shape2 | Intersect Shape
DynamicVariables=1
The center unfortunately moves around, nothing I can do about that since it can't be hard-defined
User avatar
balala
Rainmeter Sage
Posts: 16109
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Gradients not applying to shape

Post by balala »

I still have no idea what are you talking about, because as both of us (jsmorley and me) said before, we can't test your code, since we don't have a complete code and a lot of variables are missing. :confused:
Post Reply