Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/aybabtme/rgbterm
/ functions
Functions
40 in github.com/aybabtme/rgbterm
⨍
Functions
40
◇
Types & classes
2
↓ 8 callers
Function
color
(r, g, b uint8, foreground bool)
rgbterm.go:105
↓ 7 callers
Function
interpret
interpret reads from r and writes to w. While reading any color escape codes detected are replaced by the result of calling subst with the escape code
interpret.go:23
↓ 6 callers
Function
bufsForTest
(s string)
interpret_test.go:8
↓ 6 callers
Function
parseEscape
(s string)
interpret.go:82
↓ 5 callers
Method
Write
Write writes to the underlying io.Writer while substituting the color escapes in the input. See Interpret for a description of color escapes.
interpret.go:189
↓ 5 callers
Function
colorize
(color, in []byte)
rgbterm.go:95
↓ 3 callers
Function
hueToRGB
hueToRGB is a helper function for HSLtoRGB.
util.go:71
↓ 2 callers
Function
Interpret
Interpret reads data from r and writes it to w, while substituting the color escapes in the input. Color escapes are directives having one of forms o
interpret.go:151
↓ 2 callers
Function
NewInterpretingWriter
NewColorTemplateWriter creates a ColorTemplateWriter that writes to w while substituting the color escapes in the input. See Interpret for a descript
interpret.go:177
↓ 1 callers
Function
BgBytes
BgBytes colorizes the background of the input with the terminal color that matches the closest the RGB color.
rgbterm.go:79
↓ 1 callers
Function
Bytes
Bytes colorizes the input with the terminal color that matches the closest the RGB color.
rgbterm.go:67
↓ 1 callers
Function
FgBytes
Bytes colorizes the foreground with the terminal color that matches the closest the RGB color.
rgbterm.go:73
↓ 1 callers
Function
New
New creates a Rainbow writer, wrapping each byte with a new color of the rainbow. This is clearly a good idea! This is especially useful when w is som
rainbow/rainbow.go:19
↓ 1 callers
Function
grayscale
(scale uint8, foreground bool)
rgbterm.go:126
↓ 1 callers
Function
rgb
(fr, fg, fb, br, bg, bb uint8)
rgbterm.go:99
Function
BgByte
BgByte colorizes the background of the input with the terminal color that matches the closest the RGB color.
rgbterm.go:91
Function
BgString
BgString colorizes the background of the input with the terminal color that matches the closest the RGB color. This is simply a helper for Bytes.
rgbterm.go:61
Function
ExampleBgBytes
()
rgbterm_test.go:27
Function
ExampleBytes
()
rgbterm_test.go:8
Function
ExampleNew
()
rainbow/rainbow_test.go:9
Function
ExampleString
()
rgbterm_test.go:46
Function
FgByte
Byte colorizes the input with the terminal color that matches the closest the RGB color.
rgbterm.go:85
Function
FgString
FgString colorizes the foreground of the input with the terminal color that matches the closest the RGB color. This is simply a helper for Bytes.
rgbterm.go:53
Function
HSLtoRGB
HSLtoRGB is a helper that transforms 8bits RGB colors to 8bits HSL colors.
util.go:48
Function
InterpretStr
ColorizeTemplate substitutes the color escapes in the string s and returns the resulting string. See Interpret for a description of color escapes.
interpret.go:159
Function
RGBtoHSL
stolen from gorilla color: https://code.google.com/p/gorilla/source/browse/?r=ef489f63418265a7249b1d53bdc358b09a4a2ea0#hg%2Fcolor RGBtoHSL is a helper
util.go:12
Function
String
String colorizes the input with the terminal color that matches the closest the RGB color. This is simply a helper for Bytes.
rgbterm.go:45
Function
TestInterpretEmptyReplace
(t *testing.T)
interpret_test.go:67
Function
TestInterpretNilReplace
(t *testing.T)
interpret_test.go:93
Function
TestInterpretNoEscapes
(t *testing.T)
interpret_test.go:14
Function
TestInterpretOutputBrace
(t *testing.T)
interpret_test.go:40
Function
TestInterpretReplaceTooLong
(t *testing.T)
interpret_test.go:153
Function
TestInterpretSomeReplaces
(t *testing.T)
interpret_test.go:123
Function
TestParseBgEscape
(t *testing.T)
interpret_test.go:221
Function
TestParseEmptyEscape
(t *testing.T)
interpret_test.go:181
Function
TestParseFgBgEscape
(t *testing.T)
interpret_test.go:209
Function
TestParseFgEscape
(t *testing.T)
interpret_test.go:197
Function
TestParseInvalidEscape
(t *testing.T)
interpret_test.go:189
Method
Write
Write wraps each byte with an RGB color. Weeee!
rainbow/rainbow.go:25
Function
substColor
(s string)
interpret.go:105