1
0
Fork 0
mirror of https://github.com/diamondburned/cchat-discord.git synced 2024-11-01 20:34:27 +00:00
cchat-discord/segments/segments.go
diamondburned (Forefront) 87688060e9 Mostly finished.
Commits will be more descriptive from here on out.
2020-06-15 20:57:33 -07:00

26 lines
415 B
Go

package segments
import "github.com/diamondburned/cchat/text"
type Colored struct {
strlen int
color uint32
}
var (
_ text.Colorer = (*Colored)(nil)
_ text.Segment = (*Colored)(nil)
)
func NewColored(strlen int, color uint32) Colored {
return Colored{strlen, color}
}
func (color Colored) Bounds() (start, end int) {
return 0, color.strlen
}
func (color Colored) Color() uint32 {
return color.color
}