Documentation ¶
Overview ¶
Handle colors in Weechat strings.
Index ¶
Constants ¶
View Source
const ( TitleColor = "green" DefaultColor = "-:-:-" TimeColor = "grey" MsgColor = "white" ChatColor = "grey" ChanColor = "blue" NickColor = "pink" UnreadColor = "purple" // Color for messages that have particular sub-strings, // like join and leave JoinColor = "grey" LeaveColor = "grey" NickChangeColor = "grey" // color with bold BoldBlue = "blue::b" )
Variables ¶
View Source
var ( // Mostly copied verbatim from qweechat. // https://github.com/weechat/qweechat/blob/master/qweechat/weechat/color.py#L25 ColorsRegex = `[*!/_]*` ColorsStd = fmt.Sprintf(`(?:%s\d{2})`, ColorsRegex) ColorsExt = fmt.Sprintf(`(?:@%v\d{5})`, ColorsRegex) ColorsAny = fmt.Sprintf(`(?:%s|%s)`, ColorsStd, ColorsExt) ColorsRe = fmt.Sprintf( `(\x19(?:\d{2}|F%v|B\d{2}|B@\d{5}|E|\\*%v(,%v)?|@\d{5}|b.|\x1C))|\x1A.|\x1B.|\x1C`, ColorsAny, ColorsAny, ColorsAny) )
View Source
var Blue = "\033[34m"
View Source
var Cyan = "\033[36m"
View Source
var Gray = "\033[37m"
View Source
var Green = "\033[32m"
View Source
var Purple = "\033[35m"
View Source
var Red = "\033[31m"
View Source
var Reset = "\033[0m"
View Source
var White = "\033[97m"
View Source
var Yellow = "\033[33m"
Functions ¶
func Colorize ¶
When fully implemented, will replace weechat colors with colors that tview understands. Currently, not in a functional state.
func RemoveColor ¶
Parse out colors of the form [color]text[color] from the string if it exists.
Types ¶
This section is empty.
Click to show internal directories.
Click to hide internal directories.