It is currently September 21st, 2020, 4:00 am

Clock face based on the sunset and sunrise

Help with creating, editing & fixing problems with skins
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

the1ulike wrote: June 18th, 2020, 4:13 pm If there is no big difference in CPU consumption, then the online will be the choice
I said and still sustain I don't know which solution is using less CPU:
balala wrote: June 18th, 2020, 3:49 pm I can't say which solution uses less CPU. I suppose (but this definitely is just a supposition!) the offline solution would use less, but I'm not sure I am right at all.
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

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
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4112
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

A few changes,

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
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.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

eclectic-tech wrote: June 19th, 2020, 4:06 am A few changes,
Me personally at least, can't get your code to work. What the Location variable has to be in case of yandex?
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

I can get the color changed now
You do not have the required permissions to view the files attached to this post.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4112
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

balala wrote: June 19th, 2020, 5:48 am Me personally at least, can't get your code to work. What the Location variable has to be in case of yandex?
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.
User avatar
eclectic-tech
Rainmeter Sage
Posts: 4112
Joined: April 12th, 2012, 9:40 pm
Location: Cedar Point, Ohio, USA

Re: Clock face based on the sunset and sunrise

Post by eclectic-tech »

the1ulike wrote: June 19th, 2020, 7:26 am I can get the color changed now
Great! :great:
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala wrote: June 18th, 2020, 6:12 pm I said and still sustain I don't know which solution is using less CPU:
Can you show us how to set the offline approach? Blackface for the night and while for the day. Then, gradually change at sunrise and sunset times.
User avatar
balala
Rainmeter Sage
Posts: 11369
Joined: October 11th, 2010, 6:27 pm
Location: Gheorgheni, Romania

Re: Clock face based on the sunset and sunrise

Post by balala »

the1ulike wrote: June 19th, 2020, 3:28 am I want to make the background the same as the sky color. what is wrong in my code here:
the1ulike wrote: June 20th, 2020, 8:18 am Can you show us how to set the offline approach? Blackface for the night and while for the day. Then, gradually change at sunrise and sunset times.
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?).
the1ulike
Posts: 26
Joined: June 13th, 2020, 7:55 pm

Re: Clock face based on the sunset and sunrise

Post by the1ulike »

balala 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?).
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 while