Use hex values & add theme_color in manifest.json

It looks like support for hsl color values within the manifest
is limited so we have to convert the colors to hex
This commit is contained in:
Svilen Markov
2025-04-23 13:03:18 +01:00
parent efd39e1f80
commit ceebf34874
6 changed files with 70 additions and 6 deletions
+7 -5
View File
@@ -96,6 +96,12 @@ func newApplication(config *config) (*application, error) {
config.Theme.CustomCSSFile = app.resolveUserDefinedAssetPath(config.Theme.CustomCSSFile)
config.Branding.LogoURL = app.resolveUserDefinedAssetPath(config.Branding.LogoURL)
if config.Theme.BackgroundColor != nil {
config.Theme.BackgroundColorAsHex = config.Theme.BackgroundColor.ToHex()
} else {
config.Theme.BackgroundColorAsHex = "#151519"
}
if config.Branding.FaviconURL == "" {
config.Branding.FaviconURL = app.StaticAssetPath("favicon.png")
} else {
@@ -111,11 +117,7 @@ func newApplication(config *config) (*application, error) {
}
if config.Branding.AppBackgroundColor == "" {
config.Branding.AppBackgroundColor = ternary(
config.Theme.BackgroundColor != nil,
config.Theme.BackgroundColor.String(),
"hsl(240, 8%, 9%)",
)
config.Branding.AppBackgroundColor = config.Theme.BackgroundColorAsHex
}
var manifestWriter bytes.Buffer