fault.format

Color representations for character matrix displays. Uses 24-bit SGR codes for the swatch areas.

Usually, a hex code with a small leading swatch character styled with truecolor SGR codes.

itertools
import

matrix
import

palette
import

swatch
data

swatch = {
	'circle': "\u25cf",
	'ascii': "|=|",

	'square': "\u25a0",
	'triangle': "\u2582",
	'star': "\u2605",

	# short double wide triangle
	'left': "\u25e2",
	'right': "\u25e3",

	'diamond': "\u25C0\u25b6", # horizontal diamond
	'stripe': "\u25E2\u25E4", # diagonal stripe
}

identifier
function
str

identifier(color)

Convert the given RGB color into a hex string for display.

inline
function
matrix.Screen.Phrase

inline(reference, swatch, rgb)

Construct a phrase for representing an RGB color.