pill

package
v0.14.2 Latest Latest
Warning

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

Go to latest
Published: Jul 23, 2026 License: MIT Imports: 4 Imported by: 0

Documentation

Overview

Package pill is the single source of the status-badge palette: fixed truecolor fills keyed by Jira's status category (matching the Jira UI's own colors) and a luma-computed contrasting text color. Fixed RGB rather than theme colors is deliberate — theme colors resolve to basic ANSI palette slots whose actual rendering is whatever the user's terminal remaps them to, so fill/text contrast on a themed pill was a guess that broke on remapped palettes. Both the CLI plain renderer and the TUI draw their pills from here, so status reads identically everywhere.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func Fill

func Fill(status, category, colorName string) color.Color

Fill picks the pill background. Jira's own color designation (statusCategory.colorName) is preferred so the badge matches the Jira UI; when it is absent or unrecognized the stable category key is used; failing both, a per-name hash keeps distinct statuses distinguishable. Every result is a fixed truecolor fill — see the package doc for why theme-tracking was dropped.

func Foreground

func Foreground(bg color.Color) color.Color

Foreground picks near-black or near-white text for legibility on the pill fill, judged by the fill's Rec. 601 luma. Every fill is a fixed truecolor value, so the choice is deterministic.

func Style

func Style(status, category, colorName string) lipgloss.Style

Style is the badge style for a status: the category-derived fill, a contrasting foreground, bold — so the pill reads on any terminal background.

Types

This section is empty.

Jump to

Keyboard shortcuts

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