Thread for help with the new Shape meter

Help with creating, editing & fixing problems with skins
User avatar

Re: Thread for help with the new Shape meter

August 22nd, 2017, 6:25 am
balala
Rainmeter Sage   [4982 posts]

prince1142003 wrote:Should've posted that. I'm using 4.1.0 beta r2824 64-bit (Jul 7 2017).

Then not this is the problem.
User avatar

Re: Thread for help with the new Shape meter

August 28th, 2017, 12:29 am
eclectic-tech
Rainmeter Sage   [2323 posts]

prince1142003 wrote:I'm basically trying to achieve a shadow/glow effect around the circle.

I played with the stroke idea, but the problem is that the stroke is half inside the shape and half outside. If the interior of the shape is semitransparent, and the stroke is also semitransparent, they overlap in the interior region and it doesn't look good.

...

How do I fill the ring shape radially, fading from solid red at 92% to solid black at 100%?

The radial gradient on your ellipse is behaving a bit strange, but by including the optional settings for offset and radius at zero levels, it seems to behave as expected. Try this code for the ellipse shapes; I modified the radial gradient definition and extended the 'black' out to 1.25 percent so the 'red' is the dominant color of the radial ring.

Code: Select all

[BackgroundCircle]
Meter=Shape
Shape=Ellipse 100, 50, 46, 46 | Fill LinearGradient LinearGrad | StrokeWidth 0
Shape2=Ellipse 100, 50, 50, 50 | Fill RadialGradient ShadowGrad | StrokeWidth 0
Shape3=Ellipse 100, 50, 46, 46 | Fill Color 0,0,0,0 | StrokeWidth 0
Shape4=Combine Shape2 | Exclude Shape3
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
ShadowGrad=100, 50, 0, 0, 0, 0 | 0,0,0,0 ; 0.0 | 0,0,0,0 ; 0.91 | 255,0,0,255 ; 0.92 | 0,0,0,64 ; 1.25
DynamicVariables=1
UpdateDivider=-1
Group=PanelBG


You could achieve a similar effect using rounded rectangle shapes:

Code: Select all

[BackgroundCircle]
Meter=Shape
Shape=Rectangle 52, 0, 100, 100, 50 | Fill RadialGradient ShadowGrad | StrokeWidth 0
Shape2=Rectangle 54, 4, 92, 92, 46 | Fill LinearGradient1 LinearGrad | StrokeWidth 0
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1
ShadowGrad=100,50 | 0,0,0,0 ; 0.0 | 0,0,0,0 ; 0.91 | 255,0,0,255 ; 0.92 | 0,0,0,64 ; 1.25
DynamicVariables=1
UpdateDivider=-1
Group=PanelBG


Not sure why adding the optional settings to the radial gradient matter, but they do... a bug?
Hope this helps. :welcome:
User avatar

Re: Thread for help with the new Shape meter

October 3rd, 2017, 6:05 pm
kyriakos876
   [289 posts]

Pretty basic question. I wanna make a line that goes from fully transparent to white and fully transparent again.

Code: Select all

[MeterLine]
Meter=Shape
Shape=Line 50,0,50,420  | StrokeWidth 2 | Fill LinearGradient1 LinearGrad
LinearGrad=0 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1

I'm trying this but I don't think the syntax is correct. I searched in the docs for gradients in the line shape but I didn't find anything.
Also, is it possible to add a gradient in an image meter? If so, what would the syntax be again?

Code: Select all

[MeterLine2]
Meter=Image
SolidColor=255,255,255,200
W=2
H=420
User avatar

Re: Thread for help with the new Shape meter

October 3rd, 2017, 6:28 pm
balala
Rainmeter Sage   [4982 posts]

kyriakos876 wrote:I wanna make a line that goes from fully transparent to white and fully transparent again.

EDIT: Sorry if you've read my reply, I just realized I've misunderstood your question: what you've tried to do, I think is not possible. The gradient aren't related to the stroke, but to the fill color. But a Line shape doesn't has a fill color, just a Stroke color.
User avatar

Re: Thread for help with the new Shape meter

October 3rd, 2017, 6:38 pm
balala
Rainmeter Sage   [4982 posts]

But you can simulate something similar: create a Rectangle shape, instead of a Line one, without a Stroke and use the gradient on its Fill Color option:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1

I've replaced the first value of the LinearGrad option with 90, because with 0 (as you had it) on the 2 pixels wide "line" (rectangle) shape, the gradient wouldn't be properly visible.
User avatar

Re: Thread for help with the new Shape meter

October 3rd, 2017, 6:44 pm
kyriakos876
   [289 posts]

balala wrote:But you can simulate something similar: create a Rectangle shape, instead of a Line one, without a Stroke and use the gradient on its Fill Color option:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 0,0,255,128 ; 0 | 0,255,0,128 ; 1

I've replaced the first value of the LinearGrad option with 90, because with 0 (as you had it) on the 2 pixels wide "line" (rectangle) shape, the gradient wouldn't be properly visible.


Never read your answer so I don't know what you said, but this is correct :D Thanks.
Final code:

Code: Select all

[MeterLine]
Meter=Shape
Shape=Rectangle 50,0,2,420  | StrokeWidth 0 | Fill LinearGradient LinearGrad
LinearGrad=90 | 255,255,255,0 ; 0 | 255,255,255,255 ; 0.5 | 255,255,255,0 ; 1
User avatar

Re: Thread for help with the new Shape meter

October 3rd, 2017, 6:47 pm
balala
Rainmeter Sage   [4982 posts]

kyriakos876 wrote:Never read your answer

That's good, because as I said, initially I've strongly misunderstood your request. I'm glad if it's working well.
User avatar

Re: Thread for help with the new Shape meter

December 9th, 2017, 3:45 pm
eclectic-tech
Rainmeter Sage   [2323 posts]

balala wrote:EDIT: Sorry if you've read my reply, I just realized I've misunderstood your question: what you've tried to do, I think is not possible. The gradient aren't related to the stroke, but to the fill color. But a Line shape doesn't has a fill color, just a Stroke color.

@ balala
I think you overlooked that the Stroke parameter in any shape CAN use a defined gradient as the stroke parameter.
Here is code for what kyriakos876 requested.

Code: Select all

[MeterShapeLine]
Meter=Shape
X=0
Y=0
MyGrad=90 | 0,0,0,1 ; 0.0 | 255,255,255,255 ; 0.5 | 0,0,0,1 ; 1.0
; Shape=Line StartX, StartY, EndX, EndY
Shape=Line 50,0,50,420  | StrokeWidth 2 | Stroke LinearGradient MyGrad

Generates a line with a gradient stroke:

Sorry for the 2 month delayed reply... 'tis the busy season :)
User avatar

Re: Thread for help with the new Shape meter

December 9th, 2017, 6:10 pm
balala
Rainmeter Sage   [4982 posts]

eclectic-tech wrote:@ balala
I think you overlooked that the Stroke parameter in any shape CAN use a defined gradient as the stroke parameter.

Yeah, you're right (again!). I didn't think to this possibility.
User avatar

Re: Thread for help with the new Shape meter

December 9th, 2017, 7:14 pm
eclectic-tech
Rainmeter Sage   [2323 posts]

balala wrote:Yeah, you're right (again!). I didn't think to this possibility.
It is easy to understand how this could be overlooked... the Shape meter is, by far, the most complicated and powerful meter in Rainmeter.

I am still discovering new possibilities a year after it's introduction. :D

Return to “Help: Rainmeter Skins”



Who is online

Users browsing this forum: No registered users and 4 guests