Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/gookit/color
/ functions
Functions
460 in github.com/gookit/color
⨍
Functions
460
◇
Types & classes
16
↓ 3 callers
Method
IsOption
IsOption check is option code: 0-9
color_16.go:361
↓ 3 callers
Function
IsWindows
* // refer // https://github.com/Delta456/box-cli-maker/blob/7b5a1ad8a016ce181e7d8b05e24b54ff60b4b38a/detect_unix.go#L27-L45 // detect WSL as it has
detect_env.go:222
↓ 3 callers
Method
Name
************************************************************* * Color render methods *************************************************************/
color_16.go:189
↓ 3 callers
Function
NewRGBStyle
NewRGBStyle create a RGBStyle.
color_rgb.go:295
↓ 3 callers
Function
RGBFromSlice
RGBFromSlice quick RGBColor from slice[3]
color_rgb.go:138
↓ 3 callers
Function
RGBStyleFromString
RGBStyleFromString create a RGBStyle from color value string. Usage: s := RGBStyleFromString("170,187,204", "70,87,4") s.Print("message")
color_rgb.go:328
↓ 3 callers
Function
Render
Render parse color tags, return rendered string. Usage: text := Render("<info>hello</> <cyan>world</>!") fmt.Println(text)
utils.go:85
↓ 3 callers
Function
ResetTerminal
ResetTerminal terminal setting.
utils.go:21
↓ 3 callers
Function
RgbTo256
RgbTo256 convert RGB-code to 256-code
convert.go:585
↓ 3 callers
Function
RgbToAnsi
RgbToAnsi convert RGB-code to 16-code refer https://github.com/radareorg/radare2/blob/master/libr/cons/rgb.c#L249-L271
convert.go:538
↓ 3 callers
Function
RgbToHex
RgbToHex convert RGB-code to hex-code Usage: hex := RgbToHex([]int{170, 187, 204}) // hex: "aabbcc"
convert.go:482
↓ 3 callers
Function
Set
************************************************************* * global settings *************************************************************/ Set c
color.go:88
↓ 3 callers
Function
SetOutput
SetOutput set default colored text output
color.go:111
↓ 3 callers
Function
SetTerminal
SetTerminal by given code.
utils.go:11
↓ 3 callers
Function
Sprint
Sprint parse color tags, return rendered string
utils.go:93
↓ 3 callers
Method
String
String options to string. eg: "1;3"
color_16.go:36
↓ 3 callers
Function
TermColorLevel
TermColorLevel Get the currently supported color level
color.go:72
↓ 3 callers
Function
WrapTag
WrapTag wrap a tag for a string "<tag>content</>"
color_tag.go:507
↓ 3 callers
Function
formatLikePrintln
use Println, will add spaces for each arg
utils.go:138
↓ 3 callers
Function
initKernel32Proc
()
detect_windows.go:65
↓ 2 callers
Method
Add
Add option value
color_16.go:17
↓ 2 callers
Method
AddOpts
AddOpts add options
color_rgb.go:363
↓ 2 callers
Function
AddStyle
AddStyle add a style
style.go:228
↓ 2 callers
Function
AddTheme
AddTheme add a theme and style
style.go:187
↓ 2 callers
Method
Basic
Basic returns the closest approximate 16 (4 bit) color
color_rgb.go:263
↓ 2 callers
Function
Bg2Fg
Bg2Fg bg color value to fg value
color_16.go:476
↓ 2 callers
Method
Block
Block like Prompt, but will wrap a empty line
style.go:119
↓ 2 callers
Function
C256ToRgb
C256ToRgb convert an 256 color code to RGB numbers
convert.go:612
↓ 2 callers
Method
Code
Code convert to code string. eg "35"
color_16.go:343
↓ 2 callers
Method
Code
Code convert to color code string
color_256.go:262
↓ 2 callers
Method
Darken
Darken current color. eg. 96(FgLightCyan) -> 36(FgCyan) Usage: cyan := LightCyan.Darken() cyan.Print("message")
color_16.go:278
↓ 2 callers
Function
EnableDebug
EnableDebug enable debug mode
color.go:140
↓ 2 callers
Function
EnableVirtualTerminalProcessing
EnableVirtualTerminalProcessing Enable virtual terminal processing ref from github.com/konsorten/go-windows-terminal-sequences doc https://docs.micro
detect_windows.go:170
↓ 2 callers
Function
EnableVirtualTerminalProcessing
https://docs.microsoft.com/zh-cn/windows/console/console-virtual-terminal-sequences#samples from github.com/konsorten/go-windows-terminal-sequences Us
_examples/ref/cmd_color.go:37
↓ 2 callers
Function
Fg2Bg
Fg2Bg fg color value to bg value
color_16.go:486
↓ 2 callers
Function
Fprint
Fprint print rendered messages to writer Notice: will ignore print error
utils.go:52
↓ 2 callers
Function
GetColorTags
GetColorTags get all internal color tags
color_tag.go:515
↓ 2 callers
Function
HSL
HSL create RGB color from a hsl value. more see HslToRgb()
color_rgb.go:119
↓ 2 callers
Function
Hex
Hex alias of the HEX()
color_rgb.go:112
↓ 2 callers
Function
Hex2basic
Hex2basic convert hex string to basic color code.
convert.go:508
↓ 2 callers
Function
Hex2rgb
************************************************************* * region HEX <=> RGB * HEX code <=> RGB/True color code *****************************
convert.go:425
↓ 2 callers
Function
Infoln
Infoln print message with Info style
quickstart.go:199
↓ 2 callers
Function
IsMSys
IsMSys msys(MINGW64) environment, does not necessarily support color
detect_env.go:238
↓ 2 callers
Function
IsTerminal
IsTerminal returns true if the given file descriptor is a terminal. Usage: IsTerminal(os.Stdout.Fd())
detect_nonwin.go:46
↓ 2 callers
Method
Light
Light current color. eg: 36(FgCyan) -> 96(FgLightCyan). Usage: lightCyan := Cyan.Light() lightCyan.Print("message")
color_16.go:262
↓ 2 callers
Method
Log
Log message
_examples/ref/idea.go:29
↓ 2 callers
Function
NewTheme
NewTheme instance
style.go:98
↓ 2 callers
Method
Renderln
Renderln render text with newline. like Println, will add spaces for each argument Usage: color.New(color.FgGreen).Renderln("text", "more") color.
style.go:51
↓ 2 callers
Function
ResetOutput
ResetOutput reset output
color.go:114
↓ 2 callers
Function
RgbToHslInt
RgbToHslInt Converts an RGB color value to HSL. Conversion formula Assumes r, g, and b are contained in the set [0, 255] and returns [h,s,l] h: 0-360,
convert.go:787
↓ 2 callers
Method
Save
Save to global styles map
style.go:29
↓ 2 callers
Method
Set
Set fg and bg color, can also with color options
color_rgb.go:338
↓ 2 callers
Method
Values
Values to RGB values
color_rgb.go:205
↓ 2 callers
Function
compareF64
equals: return ok ? val1 : val2
utils.go:185
↓ 2 callers
Function
rgbHex256toCode
(val string, isBg bool)
color_tag.go:466
↓ 1 callers
Function
ApplyTag
ApplyTag for messages
color_tag.go:502
↓ 1 callers
Method
Basic
Basic convert color-256 to basic 16 color.
color_256.go:115
↓ 1 callers
Function
Basic2hex
Basic2hex convert basic color to hex string.
convert.go:503
↓ 1 callers
Function
Basic2nameMap
Basic2nameMap data
color_16.go:496
↓ 1 callers
Function
BasicToHex
************************************************************* * region 4bit(16) <=> RGB * 4bit(16) color <=> RGB/True color ***********************
convert.go:497
↓ 1 callers
Function
Bit24
Bit24 alias of the RGB()
color_rgb.go:83
↓ 1 callers
Function
Bit4
Bit4 a method for create Color
color_16.go:182
↓ 1 callers
Function
Bluef
Bluef print message with Blue color
colorp/colorp.go:23
↓ 1 callers
Function
Blueln
Blueln print message line with Blue color
colorp/colorp.go:26
↓ 1 callers
Function
Bluep
Bluep print message with Blue color
colorp/colorp.go:20
↓ 1 callers
Function
C256ToRgbV1
C256ToRgbV1 convert an 256 color code to RGB numbers refer https://github.com/torvalds/linux/commit/cec5b2a97a11ade56a701e83044d0a2a984c67b4
convert.go:626
↓ 1 callers
Method
Code
Code to color code string without prefix. eg: "204;123;56"
color_rgb.go:210
↓ 1 callers
Method
Code
Code convert to color code string
color_rgb.go:392
↓ 1 callers
Function
Cyanf
Cyanf print message with Cyan color
colorp/colorp.go:32
↓ 1 callers
Function
Cyanln
Cyanln print message line with Cyan color
colorp/colorp.go:35
↓ 1 callers
Function
Cyanp
Cyanp print message with Cyan color
colorp/colorp.go:29
↓ 1 callers
Function
Errorf
Errorf print message with Error style
quickstart.go:214
↓ 1 callers
Function
Errorf
Errorf print message with Error style
colorp/colorp.go:99
↓ 1 callers
Method
Errorf
Errorf message
quickstart.go:114
↓ 1 callers
Function
Errorln
Errorln print message with Error style
quickstart.go:217
↓ 1 callers
Function
Errorln
Errorln print message with Error style
colorp/colorp.go:102
↓ 1 callers
Method
Errorln
Errorln message print
style.go:297
↓ 1 callers
Method
Errorln
Errorln message
quickstart.go:119
↓ 1 callers
Function
Errorp
Errorp print message with Error color
quickstart.go:211
↓ 1 callers
Function
Errorp
Errorp print message with Error color
colorp/colorp.go:96
↓ 1 callers
Function
ForceSetColorLevel
ForceSetColorLevel force open color render
color.go:124
↓ 1 callers
Method
FullCode
FullCode convert to color code string
color_rgb.go:395
↓ 1 callers
Function
Grayf
Grayf print message with Gray color
colorp/colorp.go:41
↓ 1 callers
Function
Grayln
Grayln print message line with Gray color
colorp/colorp.go:44
↓ 1 callers
Function
Grayp
Grayp print message with Gray color
colorp/colorp.go:38
↓ 1 callers
Function
Greenf
Greenf print message with Green color
colorp/colorp.go:50
↓ 1 callers
Function
Greenln
Greenln print message line with Green color
colorp/colorp.go:53
↓ 1 callers
Function
Greenp
Greenp print message with Green color
colorp/colorp.go:47
↓ 1 callers
Function
HSLInt
HSLInt create RGB color from a hsl int value. more see HslIntToRgb()
color_rgb.go:129
↓ 1 callers
Function
HSVIntToRGBInts
HSVIntToRGBInts Converts an HSL color value to RGB slice. Conversion formula adapted from https://en.wikipedia.org/wiki/HSL_and_HSV#HSV_to_RGB Assume
convert.go:868
↓ 1 callers
Function
HexToRGB
HexToRGB alias of the HexToRgb()
convert.go:428
↓ 1 callers
Function
Hsl
Hsl alias of the HSL()
color_rgb.go:125
↓ 1 callers
Function
Infof
Infof print message with Info style
quickstart.go:196
↓ 1 callers
Function
Infof
Infof print message with Info style
colorp/colorp.go:81
↓ 1 callers
Method
Infof
Infof message print
style.go:272
↓ 1 callers
Method
Infof
Infof message
quickstart.go:98
↓ 1 callers
Function
Infoln
Infoln print message with Info style
colorp/colorp.go:84
↓ 1 callers
Method
Infoln
Infoln message print
style.go:277
↓ 1 callers
Method
Infoln
Infoln message
quickstart.go:103
↓ 1 callers
Function
Infop
************************************************************* * quick use style print message ******************************************************
quickstart.go:193
← previous
next →
101–200 of 460, ranked by callers