Added helper functions in package text
This package adds back the Plain function from the old package text as well as a new function called SolidColor that returns a new RGBA color with the alpha bits maxed out. These functions are there for convenience. They're also outside the scope of the code generator and repository.
This commit is contained in:
parent
7b9b4864a5
commit
e2751cc260
|
@ -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)
|
||||
}
|
Loading…
Reference in New Issue