WasatchPhotonics / ENLIGHTEN

Open-source spectroscopy application for controlling and taking measurements from Wasatch Photonics spectrometers.
https://wasatchphotonics.com/product-category/software/
MIT License
3 stars 6 forks source link

add theme generator script #323

Closed samiebee43 closed 10 months ago

samiebee43 commented 10 months ago

What's been done

image

What's yet to be done

How it works (for fun)

The script copies a whole folder to make a complete theme but it only modifies enlighten.css, which drives at least 95% of Enlighten's colors. I use a HSL-based color find-replace to replace shades of gray from the light theme with shades of a particular target color. This works on embedded HSL values in the stylesheet as well as short and long hex codes (ex: #FFF, #FF0000).

There are a few colors that don't get replaced, such as the Raman button. So theme gen can be used to create a starting point for themes. It may require some additional tweaking to get it just right.

I might want to do a Halloween theme which consists of mostly dark colors with a couple of orange accents added in after the fact

samiebee43 commented 10 months ago

image

Ready for review.

To Do (post merge)

*explanation of "themed darkmode toggle"

Say you had the pink theme selected. With this revision, if you click the dark mode icon (moon) then it will switch to dark. If you click it again it will switch to light. It would be better if toggling twice takes you back to the theme you were on, and if the user can customize (and save) a preference of both light and dark themes.

For example I might use pink theme as my light mode and darkblue as my dark mode. This addition isn't worthwhile until the modified "dark..." themes have their color logic adjusted to actually be darker.

samiebee43 commented 10 months ago

Added more support for custom dark themes:

image