I said and still sustain I don't know which solution is using less CPU:
It is currently April 26th, 2024, 2:18 pm
Clock face based on the sunset and sunrise
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Clock face based on the sunset and sunrise
-
- Posts: 34
- Joined: June 13th, 2020, 7:55 pm
Re: Clock face based on the sunset and sunrise
I want to make the background the same as the sky color. what is wrong in my code here:
Code: Select all
[MeasureSkyColor]
Measure=WebParser
UpdateRate=1000
Url="http://time.yandex.com/sync.json?lang=en&geo=#location#"
RegExp="(?siU).*"skyColor":#(.*),"
StringIndex=5
FinishAction=[!ShowMeter MeterDisk][!UpdateMeter *][!Redraw]
[MeterDisk]
Meter=Roundline
X=50
Y=65
W=120
H=120
StartAngle=4.712
RotationAngle=6.283
LineLength=110
LineColor=[MeasureSkyColor]
MeterTint LineColor=90
Solid=1
AntiAlias=1
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Clock face based on the sunset and sunrise
A few changes,
I modified the URL to HTTPS://...
You are using a new webparser, so the StringIndex capturing starts at 1; ex. StringIndex=1
You captured the quotation marks around the hex color, which you do not need
I added a substitute to remove the # from the hex color after capture for use in the meter
Commented out invalid lines in your roundline meter and changed the size to half the width so it is centered
Added DynamicVariables=1 to the roundline
This should return colors from "skyblue" to "black" depending on the #Location# value.
Code: Select all
[MeasureSkyColor]
Measure=WebParser
UpdateRate=600
Url="https://time.yandex.com/sync.json?lang=en&geo=#Location#"
RegExp="(?siU).*,"skyColor":"(.*)","
StringIndex=1
FinishAction=[!ShowMeter MeterDisk][!UpdateMeter *][!Redraw]
Substitute="#":""
[MeterDisk]
Meter=Roundline
;X=50
;Y=65
W=120
H=120
StartAngle=4.712
RotationAngle=6.283
LineLength=60
LineColor=[&MeasureSkyColor]
;MeterTint
;LineColor=90
Solid=1
AntiAlias=1
DynamicVariables=1
You are using a new webparser, so the StringIndex capturing starts at 1; ex. StringIndex=1
You captured the quotation marks around the hex color, which you do not need
I added a substitute to remove the # from the hex color after capture for use in the meter
Commented out invalid lines in your roundline meter and changed the size to half the width so it is centered
Added DynamicVariables=1 to the roundline
This should return colors from "skyblue" to "black" depending on the #Location# value.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Clock face based on the sunset and sunrise
Me personally at least, can't get your code to work. What the Location variable has to be in case of yandex?
-
- Posts: 34
- Joined: June 13th, 2020, 7:55 pm
Re: Clock face based on the sunset and sunrise
I can get the color changed now
You do not have the required permissions to view the files attached to this post.
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
Re: Clock face based on the sunset and sunrise
The code is a number you get at the yandex site from the "Informer" details. That number is set as #Location#; ex. &geo-200 will show the time and information for Los Angeles CA.
:: My DA Gallery :: Rainmeter DA Gallery :: Rainmeter Workshops :: Rainmeter Documentation :: BBCode Guide ::
-
- Rainmeter Sage
- Posts: 5407
- Joined: April 12th, 2012, 9:40 pm
- Location: Cedar Point, Ohio, USA
-
- Posts: 34
- Joined: June 13th, 2020, 7:55 pm
-
- Rainmeter Sage
- Posts: 16173
- Joined: October 11th, 2010, 6:27 pm
- Location: Gheorgheni, Romania
Re: Clock face based on the sunset and sunrise
Gradually change at Sunrise and Sunset is possible with the offline solution, but changing it depending on the "sky color" (however I'm not entirely sure what this does mean), is probably not. At least not if the "sky color" is related to the weather conditions as well (is it?).
-
- Posts: 34
- Joined: June 13th, 2020, 7:55 pm
Re: Clock face based on the sunset and sunrise
You are right, the "skyColor" is not reflecting the weather effect on it. I'm interested in the offline approach without colors, just black and whilebalala wrote: ↑June 20th, 2020, 9:06 am Gradually change at Sunrise and Sunset is possible with the offline solution, but changing it depending on the "sky color" (however I'm not entirely sure what this does mean), is probably not. At least not if the "sky color" is related to the weather conditions as well (is it?).