Toggling between dark and light mode with adb

When developing an app that has both a dark and a light theme. I often find myself switching between dark and light mode to see how the UI looks. Previously I've been doing the toggling manually via Quick Settings.

However I recently found out that you can toggle between modes via adb (Stack Overflow)

So I made a simple shell script that toggles between modes.

How to use:

Demo:

Gif showing toggling between modes