24 lines
815 B
Go
24 lines
815 B
Go
// Copyright (c) 2026 Petr Balvín <opensource@petrbalvin.org> (https://petrbalvin.org)
|
|||
|
|
// SPDX-License-Identifier: PolyForm-Noncommercial-1.0.0
|
||
|
|
|
||
|
|
package web
|
||
|
|
|
||
|
|
import "slices"
|
||
|
|
|
||
|
|
// Themes are the colour schemes the admin UI ships, in the order the
|
||
|
|
// settings switch lists them. Each scheme takes its values from the
|
||
|
|
// stops of the matplotlib colour map of the same name.
|
||
|
|
var Themes = []string{"viridis", "plasma", "magma"}
|
||
|
|
|
||
|
|
// DefaultTheme is the scheme an account without a choice renders in.
|
||
|
|
const DefaultTheme = "viridis"
|
||
|
|
|
||
|
|
// ThemeCookie carries the colour scheme across the login screen, where
|
||
|
|
// no account is known yet.
|
||
|
|
const ThemeCookie = "volumen_admin_theme"
|
||
|
|
|
||
|
|
// ValidTheme reports whether the value is a shipped colour scheme.
|
||
|
|
func ValidTheme(theme string) bool {
|
||
|
|
return slices.Contains(Themes, theme)
|
||
|
|
}
|