Page 1 of 1

Change minute and hour color

Posted: 14 Mar 2025, 05:48
by piotarock
Hello Devs,

How are you? I am trying to create a watchface where the digits on minute and hour hand change. I have followed the code implemented by @asoo but it seems I am missing a point. I have attached the screenshots of my folder and code. Please assist me on this.
Spoiler
Image

Image

Image

Re: Change minute and hour color

Posted: 14 Mar 2025, 06:22
by asoo
piotarock wrote: 14 Mar 2025, 05:48
Hello Devs,

How are you? I am trying to create a watchface where the digits on minute and hour hand change. I have followed the code implemented by @asoo but it seems I am missing a point. I have attached the screenshots of my folder and code. Please assist me on this.
Spoiler
Image

Image

Image
I suggest you to also inform me how it is incorrect and what you want the script done.
And if possible, please attach the entire project. It will help to analyze the problem quickly.

From the image you attached, it seems that the display setting according to the specified folder should be fine. However, I don't have the entire project, so I can't analyze it correctly.

Re: Change minute and hour color

Posted: 14 Mar 2025, 07:02
by piotarock
Thank you very much @asoo. I will attach the entire project once I leave my office. Should I PM you or its okay if I attach it here.

Re: Change minute and hour color

Posted: 14 Mar 2025, 07:03
by piotarock
Plus, does the entire project include assets and JS files? If so, I think I will have to zip the files.

Re: Change minute and hour color

Posted: 14 Mar 2025, 07:11
by piotarock
The incorrect part is that the colors of minutes and hour digits are not changing on click. All the other items are changing apart from the digital time.

Re: Change minute and hour color

Posted: 14 Mar 2025, 10:51
by asoo
piotarock wrote: 14 Mar 2025, 07:11
The incorrect part is that the colors of minutes and hour digits are not changing on click. All the other items are changing apart from the digital time.
If your script is correct, when you change the color of some elements, it does not change color. You try to turn off the screen and turn it on again to refresh the color change.

In the Digital time section, if I guess right, you did not use seconds, right?
If so, when you change the color of the Digital time, you have to refresh the screen to change the color or wait for the element to change. In this case, you have to wait for the minute to change the color, or turn off the screen and turn it on again, which will also work. Or you can put a script to turn off the screen every time the color changes.

Code: Select all

const result = hmSetting.setScreenOff()
And when you turn on the screen again, the color will be refreshed.

Or you put seconds in. When you press to change the color, the digital time data will change every second, causing the color to change as well.

I'm not sure if this is the best way, but this is how I do it. It works for me.

Re: Change minute and hour color

Posted: 14 Mar 2025, 10:56
by asoo
piotarock wrote: 14 Mar 2025, 07:02
Thank you very much @asoo. I will attach the entire project once I leave my office. Should I PM you or its okay if I attach it here.
If you don't want to publish the project yet, PM me.

Or if you want others to help you fix it, you can attach it in the post.

PS. Others may have different and better solutions than mine.

Re: Change minute and hour color

Posted: 14 Mar 2025, 11:07
by piotarock
asoo wrote: 14 Mar 2025, 10:56
piotarock wrote: 14 Mar 2025, 07:02
Thank you very much @asoo. I will attach the entire project once I leave my office. Should I PM you or its okay if I attach it here.
If you don't want to publish the project yet, PM me.

Or if you want others to help you fix it, you can attach it in the post.

PS. Others may have different and better solutions than mine.
Thank you very much for your response. I will try your way. If it works, I will stick to it. Thank you very much once again.

Re: Change minute and hour color

Posted: 15 Mar 2025, 19:40
by SashaCX75
If there are no seconds on the watch face, the image may change with a delay. For example, when the minutes and minutes change when the screen is switched on and off.

To set coordinates you use a variable related to the screen size. If you have not defined this variable earlier in the code, it may cause a problem.

Re: Change minute and hour color

Posted: 15 Mar 2025, 22:35
by piotarock
Thank you @SashaCX75. Asoo assisted me on this matter.