diff --git a/text/text_extras.go b/text/text_extras.go new file mode 100644 index 0000000..7afdcad --- /dev/null +++ b/text/text_extras.go @@ -0,0 +1,12 @@ +package text + +// Plain creates a new text.Rich without any formatting segments. +func Plain(text string) Rich { + return Rich{Content: text} +} + +// SolidColor takes in a 24-bit RGB color and overrides the alpha bits with +// 0xFF, making the color solid. +func SolidColor(rgb uint32) uint32 { + return rgb | (0xFF << 24) +}