Files

25 lines
816 B
Go

// Copyright (c) 2026 Storm Dragon
// SPDX-License-Identifier: GPL-3.0-or-later
package screen
// Colors are RGB, tagged ANSI palette indices, or the terminal default.
const (
ColorDefault uint32 = 1 << 31
ColorIndexed uint32 = 1 << 30
Bold uint32 = 1
Underline uint32 = 6 // libvterm retains single/double/curly underline.
Italic uint32 = 8
Blink uint32 = 16
Reverse uint32 = 32
Strike uint32 = 64
// VCSA high bit can mean blink, background intensity or a font bit. Keep
// it for change/highlight detection without claiming a specific style.
ConsoleHigh uint32 = 128
)
func (a Attribute) Default() bool {
return a.Style == 0 && (a.Foreground == ColorDefault || a.Foreground == ColorIndexed|7) &&
(a.Background == ColorDefault || a.Background == ColorIndexed)
}