2023-06-19 23:42:47 +02:00
|
|
|
// SPDX-FileCopyrightText: Copyright The Miniflux Authors. All rights reserved.
|
|
|
|
// SPDX-License-Identifier: Apache-2.0
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2023-08-11 04:46:45 +02:00
|
|
|
package model // import "miniflux.app/v2/internal/model"
|
2017-11-20 06:10:04 +01:00
|
|
|
|
2017-11-28 06:30:04 +01:00
|
|
|
// Themes returns the list of available themes.
|
|
|
|
func Themes() map[string]string {
|
2017-11-20 06:10:04 +01:00
|
|
|
return map[string]string{
|
2019-09-22 04:10:08 +02:00
|
|
|
"light_serif": "Light - Serif",
|
|
|
|
"light_sans_serif": "Light - Sans Serif",
|
|
|
|
"dark_serif": "Dark - Serif",
|
|
|
|
"dark_sans_serif": "Dark - Sans Serif",
|
|
|
|
"system_serif": "System - Serif",
|
|
|
|
"system_sans_serif": "System - Sans Serif",
|
2017-11-20 06:10:04 +01:00
|
|
|
}
|
|
|
|
}
|
2017-11-25 21:44:32 +01:00
|
|
|
|
2018-07-19 07:30:05 +02:00
|
|
|
// ThemeColor returns the color for the address bar or/and the browser color.
|
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/Manifest#theme_color
|
|
|
|
// https://developers.google.com/web/tools/lighthouse/audits/address-bar
|
2021-11-28 16:20:51 +01:00
|
|
|
// https://developer.mozilla.org/en-US/docs/Web/HTML/Element/meta/name/theme-color
|
|
|
|
func ThemeColor(theme, colorScheme string) string {
|
2018-07-19 07:30:05 +02:00
|
|
|
switch theme {
|
2019-09-22 04:10:08 +02:00
|
|
|
case "dark_serif", "dark_sans_serif":
|
2018-07-19 07:30:05 +02:00
|
|
|
return "#222"
|
2021-11-28 16:20:51 +01:00
|
|
|
case "system_serif", "system_sans_serif":
|
|
|
|
if colorScheme == "dark" {
|
|
|
|
return "#222"
|
|
|
|
}
|
|
|
|
|
|
|
|
return "#fff"
|
2018-07-19 07:30:05 +02:00
|
|
|
default:
|
|
|
|
return "#fff"
|
|
|
|
}
|
|
|
|
}
|