theme

package
v0.6.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Mar 17, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package theme provides Glean's brand colors and theme utilities for consistent CLI styling. Colors sourced directly from www.glean.com (#343CED confirmed as dominant primary, 60 occurrences).

Index

Constants

View Source
const (
	GleanBlueHex   = "#343CED" // Primary brand blue/indigo (was incorrectly #4339F2)
	GleanGreenHex  = "#D8FD49" // Yellow-green accent
	GleanPurpleHex = "#E16BFF" // Purple accent
	GleanOrangeHex = "#FF7E4C" // Orange accent
	GleanErrorHex  = "#FF492C" // Coral red (error / destructive)
	GleanMutedHex  = "#777867" // Warm gray (muted text, on-brand)
	GleanCreamHex  = "#E1DFD7" // Warm off-white (surface)

	// Legacy aliases kept for backward compatibility.
	GleanYellowHex = GleanGreenHex
)

Glean brand palette — sourced from www.glean.com.

Variables

View Source
var (
	// Blue applies Glean's primary brand color (#343CED).
	Blue = Color{color.New(color.FgHiBlue), GleanBlueHex}.SprintFunc()

	// Muted applies Glean's warm gray for secondary / dimmed text.
	Muted = Color{color.New(color.FgHiBlack), GleanMutedHex}.SprintFunc()

	// Bold makes text bold.
	Bold = color.New(color.Bold).SprintFunc()

	// Success applies a bright accent for positive outcomes.
	Success = Color{color.New(color.FgHiGreen), GleanGreenHex}.SprintFunc()

	// Err applies Glean's coral red for errors.
	Err = Color{color.New(color.FgHiRed), GleanErrorHex}.SprintFunc()

	// Secondary is an alias for Muted (backward compat).
	Secondary = Muted

	// Yellow is kept for backward compat (maps to green accent now).
	Yellow = Color{color.New(color.FgHiYellow), GleanGreenHex}.SprintFunc()
)

Branded color functions for consistent CLI stdout output.

Functions

func DisableColors

func DisableColors()

DisableColors disables color output.

func EnableColors

func EnableColors()

EnableColors enables color output.

func NoColor

func NoColor() bool

NoColor returns true if color output is disabled.

func StyleFunc

func StyleFunc(noColor bool, style ColorFunc) func(any) string

StyleFunc returns a template function that respects noColor.

func TemplateFuncs

func TemplateFuncs(noColor bool) template.FuncMap

TemplateFuncs returns template helpers that respect color settings.

Types

type Color

type Color struct {
	*color.Color
	// contains filtered or unexported fields
}

Color wraps fatih/color with the hex value for lipgloss compatibility.

func (Color) SprintFunc

func (c Color) SprintFunc() func(a ...interface{}) string

SprintFunc returns a function that colorizes text.

func (Color) ToLipgloss

func (c Color) ToLipgloss() lipgloss.Color

ToLipgloss returns the equivalent lipgloss.Color.

type ColorFunc

type ColorFunc = func(a ...interface{}) string

ColorFunc is a function that applies color to text.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL