I recently published my first Kotlin Multiplatform...
# feed
j
I recently published my first Kotlin Multiplatform library Kastro. https://github.com/yoxjames/Kastro Kastro is based heavily on commons-suncalc and can calculate information about the moon and sun, specifically the time of relevant solar/lunar events like: * Sunset and sunrise times * Various twilight phase times * Golden hour/blue hour start and end * Moon phase time (full moon, new moon, etc) * Moonset and moonrise time * And so much more! Kastro produces an ordered (temporally) lazily calculated
Sequence
of these events that you can then use any
Sequence
operator to extract information or transform the result. The README contains lots of relevant examples. If you are curious, I have also built a a live demo coded entirely in KotlinJS so you can try Kastro from the comfort of your favorite browser!
🌞 5
🌚 5
🎉 3
K 1
j
I have zero use for this but I find it really cool 😎 Awesome demo as well!
j
Thanks! The demo was a lot of work but fun to make! Learned a ton. I intend to use Kastro as a piece of some larger projects I have cooking. However, I thought it was useful as a small library on its own. Right now I actually use it to do things like turn on my lights at sundown (home automation). Since it's an ordered
Sequence
it can easily be converted to a
Flow
that simply waits until the event time (the last example on the README is essentially what I did).
😄 1
👍 1
s
I intend to use Kastro as a piece of some larger projects I have cooking. However, I thought it was useful as a small library on its own.
That’s the spirit! 😎 👌