Tutorials

Switch an image or layout if day or night (or by time)

Switch an image or layout if day or night (or by time) #

howing an image based on a condition is pretty simple, to switch between one image and another based on day/night status you can do the following:

  • Create an OverlapLayer that will contain both images
  • Add an Image object to the layer just created and pick the night image
  • Select the “Opacity” property and switch it to “formula” mode using the calculator icon
  • Click it and enter following code $if(ai(isday), 0, 100)$ this will set opacity to 0 during the day and to 100 in the night
  • Add another Image object to the layer and pick the day image
  • Switch Opacity to fomula as above and enter $if(ai(isday), 100, 0)$
  • Done!

This approach can be used also with text (using the color property) or with entire layers using a formula in the “visibility” property of the layer tab and returning either ALWAYS or NEVER.

...

Weather Icon Komponent Creation (Image or SVG)

Weather Icon Komponent Creation (Image or SVG) #

Kustom includes a very basic Weather Image Icon Komponent that allows you to show an image based on the current weather condition (or a forecast by changing the “icon” global to “wf(icon, X)” where X is the number of days, 0 for today and so on)…

The Komponent is very easy to edit and has meaningful image file names so you can create your own in a few steps:

...




Privacy Policy