A script to rotate the hue of a Forgejo theme
  • Python 67.4%
  • CSS 32.6%
Find a file
2026-02-08 20:19:21 +01:00
gitea-auto-green.css Initial commit 2026-02-08 13:59:15 +01:00
main.py Initial commit 2026-02-08 13:59:15 +01:00
pyproject.toml Initial commit 2026-02-08 13:59:15 +01:00
README.org Update README.org 2026-02-08 20:19:21 +01:00

Just rotate your favorite color theme for forgejo

How to use it?

  1. First, find your CSS theme that you want as a base:

    1. If it's a default Forgejo theme on your instance, go to:

    example: https://<instance>/assets/css/theme-gitea-auto.css

  2. Get all the theme files and format them (easier for the next step)
  3. Identify the color that you want:

    1. Usually all the color-primary<-…>
  4. Copy it into a big string
  5. Put the string main.py into the file under name MYSTR
  6. Adjust the rotation angle ROTATION_ANGLE
  7. Run the script
  8. Paste the results while importing the base CSS theme used

    1. See example in gitea-auto-green.css

Roadmap [0/4]

By order of priority

  1. Fetch directly the CSS theme from the URL and parse json

    1. Just adjust color-primary
    2. Resolve var? (just ignore)
  2. Auto-generate resulting css

    1. Import the base theme if available on the instance.
    2. If not available on the base instance, just regenerate the whole CSS.
  3. Script to rotate favicon and logo svg?
  4. Hook to regenerate theme on Forgejo update?