brand

package
v0.0.0-...-22d78c6 Latest Latest
Warning

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

Go to latest
Published: May 12, 2026 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Render

func Render(variant Variant, mode ColorMode) string

Render returns the wordmark text colored for the given mode. VariantFull emits the multi-line banner; VariantShort emits a single word; any other variant (including VariantMedium) emits the inline "OpenCode ADVANCE" form.

Types

type Assets

type Assets struct {
	FullLines []string
	Medium    string
	Short     string
	Palette   Palette
}

func MustAssets

func MustAssets() Assets

MustAssets returns the embedded wordmark asset bundle, loading it on first call via sync.Once. Panics if the embedded files are malformed — this is a compile-time-adjacent failure and should never happen in a correctly built binary.

type ColorMode

type ColorMode string
const (
	ColorModeTruecolor ColorMode = "truecolor"
	ColorMode256       ColorMode = "256"
	ColorModeMono      ColorMode = "mono"
)

func DetectColorMode

func DetectColorMode(env Environment) ColorMode

DetectColorMode picks the richest color mode the environment advertises. Non-TTY or NO_COLOR=1 forces mono. COLORTERM containing "truecolor" or "24bit" selects truecolor. TERM containing "256color" selects 256. Else mono.

type ColorSpec

type ColorSpec struct {
	Hex     string
	Ansi256 int
	RGB     RGB
}

type Environment

type Environment struct {
	IsTTY     bool
	NoColor   bool
	Term      string
	ColorTerm string
}

type Palette

type Palette struct {
	IVORY         ColorSpec
	INDIGO        ColorSpec
	INDIGO_BRIGHT ColorSpec
	INDIGO_GLOW   ColorSpec
}

type RGB

type RGB struct {
	R int
	G int
	B int
}

type Variant

type Variant string
const (
	VariantFull   Variant = "full"
	VariantMedium Variant = "medium"
	VariantShort  Variant = "short"
)

Jump to

Keyboard shortcuts

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