Documentation
¶
Index ¶
Constants ¶
const ThemeDefault = "superplane"
ThemeDefault renders when the URL asks for no theme, or for a name that this package does not know.
Variables ¶
var ColorParams = []string{"accent", "manual", "text", "muted", "bg", "border"}
ColorParams maps a URL parameter to the palette color it replaces. The settings page and any hand-written README URL use these names.
Functions ¶
func NormalizeColor ¶
NormalizeColor returns a "#rrggbb" color, or an empty string when the value is not a six-digit hex color. The caller treats empty as "keep the color the theme sets".
func NormalizeTheme ¶
NormalizeTheme maps a URL value to a known theme name. An unknown name falls back to the default, so a typo still renders a badge.
func ThemeNames ¶
func ThemeNames() []string
ThemeNames returns the theme names a URL can ask for, default first.
Types ¶
type Colors ¶
type Colors struct {
Accent string
Manual string
Text string
Subtle string
Background string
Border string
}
Colors replaces single theme colors. Every empty field keeps the color the theme sets.
func ColorsFromQuery ¶
ColorsFromQuery reads the color parameters. It drops anything that is not a six-digit hex color, so a typo keeps the theme color.
type Input ¶
type Input struct {
PeriodDays int
SuperplaneMerged int
PeopleMerged int
SuperplaneWaste int
PreviousSuperplaneMerged int
PreviousPeopleMerged int
HasPrevious bool
CostCents *int64
Days []DayPoint
Updated time.Time
Size Size
// Theme names a palette. An empty or unknown name uses ThemeDefault.
Theme string
// Colors replaces single colors from that theme.
Colors Colors
}
Input is everything the SVG needs. CostCents is nil when the cost switch is off. The renderer never reads a URL flag.
Layout follows dark README stat cards (Repobeats-style): rounded card, large share, metric row, and a quiet daily chart. Series colors stay the Velocity chart colors.