Documentation
¶
Overview ¶
* @Author: nijineko * @Date: 2025-06-07 11:13:20 * @LastEditTime: 2025-06-07 11:13:26 * @LastEditors: nijineko * @Description: quick method for set background color * @FilePath: \colorize\background.go
* @Author: nijineko * @Date: 2025-06-07 10:44:04 * @LastEditTime: 2025-06-08 11:42:11 * @LastEditors: nijineko * @Description: define color constants * @FilePath: \colorize\color.go
* @Author: nijineko * @Date: 2025-06-07 10:59:07 * @LastEditTime: 2025-06-07 12:09:24 * @LastEditors: nijineko * @Description: remove color from text * @FilePath: \colorize\remove.go
* @Author: nijineko * @Date: 2025-06-07 10:53:28 * @LastEditTime: 2025-06-07 11:00:21 * @LastEditors: nijineko * @Description: set color for text * @FilePath: \colorize\set.go
* @Author: nijineko * @Date: 2025-06-07 11:05:59 * @LastEditTime: 2025-06-08 11:45:47 * @LastEditors: nijineko * @Description: quick method for set text color * @FilePath: \colorize\text.go
Index ¶
- Constants
- func BlackBackground(Text string) string
- func BlackText(Text string) string
- func BlueBackground(Text string) string
- func BlueText(Text string) string
- func BrightBlueBackground(Text string) string
- func BrightBlueText(Text string) string
- func BrightCyanBackground(Text string) string
- func BrightCyanText(Text string) string
- func BrightGreenBackground(Text string) string
- func BrightGreenText(Text string) string
- func BrightMagentaBackground(Text string) string
- func BrightMagentaText(Text string) string
- func BrightRedBackground(Text string) string
- func BrightRedText(Text string) string
- func BrightWhiteBackground(Text string) string
- func BrightWhiteText(Text string) string
- func BrightYellowBackground(Text string) string
- func BrightYellowText(Text string) string
- func CyanBackground(Text string) string
- func CyanText(Text string) string
- func GrayBackground(Text string) string
- func GrayText(Text string) string
- func GreenBackground(Text string) string
- func GreenText(Text string) string
- func MagentaBackground(Text string) string
- func MagentaText(Text string) string
- func RedBackground(Text string) string
- func RedText(Text string) string
- func Remove(Text string) string
- func Set(Text string, Config int, BackgroundColor int, TextColor int) string
- func WhiteBackground(Text string) string
- func WhiteText(Text string) string
- func YellowBackground(Text string) string
- func YellowText(Text string) string
Constants ¶
const ( DEFAULT_CONFIG = 0 // Default configuration DEFAULT_BACKGROUND = 0 // Default background color DEFAULT_TEXT = TextWhite // Default text color )
define default constants
const ( ConfigDefault = iota // Default configuration ConfigBold // Bold text ConfigDim // Dim text ConfigItalic // Italic text ConfigUnderline // Underlined text ConfigBlinking // Blinking text ConfigReverse = iota + 1 // Reversed colors ConfigHidden // Hidden text )
define color constants
const ( BackgroundBlack = iota + 40 // Black background BackgroundRed // Red background BackgroundGreen // Green background BackgroundYellow // Yellow background BackgroundBlue // Blue background BackgroundMagenta // Magenta background BackgroundCyan // Cyan background BackgroundWhite // White background BackgroundGray = iota + 92 // Gray background (bright black) BackgroundBrightRed // Bright red background BackgroundBrightGreen // Bright green background BackgroundBrightYellow // Bright yellow background BackgroundBrightBlue // Bright blue background BackgroundBrightMagenta // Bright magenta background BackgroundBrightCyan // Bright cyan background BackgroundBrightWhite // Bright white background )
define background color constants
const ( TextBlack = iota + 30 // Black text TextRed // Red text TextGreen // Green text TextYellow // Yellow text TextBlue // Blue text TextMagenta // Magenta text TextCyan // Cyan text TextWhite // White text TextGray = iota + 82 // Gray text (bright black) TextBrightRed // Bright red text TextBrightGreen // Bright green text TextBrightYellow // Bright yellow text TextBrightBlue // Bright blue text TextBrightMagenta // Bright magenta text TextBrightCyan // Bright cyan text TextBrightWhite // Bright white text )
define text color constants
Variables ¶
This section is empty.
Functions ¶
func BlackBackground ¶
*
- @description: Set background color to black
- @param {string} Text
- @return {string} formatted text with black background
func BlackText ¶
*
- @description: Set text color to black
- @param {string} Text
- @return {string} formatted text with black color
func BlueBackground ¶
*
- @description: Set background color to blue
- @param {string} Text
- @return {string} formatted text with black background
func BlueText ¶
*
- @description: Set text color to blue
- @param {string} Text
- @return {string} formatted text with black color
func BrightBlueBackground ¶ added in v1.0.1
*
- @description: Set background color to bright blue
- @param {string} Text
- @return {string} formatted text with black background
func BrightBlueText ¶ added in v1.0.1
*
- @description: Set text color to bright blue
- @param {string} Text
- @return {string} formatted text with black color
func BrightCyanBackground ¶ added in v1.0.1
*
- @description: Set background color to bright cyan
- @param {string} Text
- @return {string} formatted text with black background
func BrightCyanText ¶ added in v1.0.1
*
- @description: Set text color to bright cyan
- @param {string} Text
- @return {string} formatted text with black color
func BrightGreenBackground ¶ added in v1.0.1
*
- @description: Set background color to bright green
- @param {string} Text
- @return {string} formatted text with black background
func BrightGreenText ¶ added in v1.0.1
*
- @description: Set text color to bright green
- @param {string} Text
- @return {string} formatted text with black color
func BrightMagentaBackground ¶ added in v1.0.1
*
- @description: Set background color to bright magenta
- @param {string} Text
- @return {string} formatted text with black background
func BrightMagentaText ¶ added in v1.0.1
*
- @description: Set text color to bright magenta
- @param {string} Text
- @return {string} formatted text with black color
func BrightRedBackground ¶ added in v1.0.1
*
- @description: Set background color to bright red
- @param {string} Text
- @return {string} formatted text with black background
func BrightRedText ¶ added in v1.0.1
*
- @description: Set text color to bright red
- @param {string} Text
- @return {string} formatted text with black color
func BrightWhiteBackground ¶ added in v1.0.1
*
- @description: Set background color to bright white
- @param {string} Text
- @return {string} formatted text with black background
func BrightWhiteText ¶ added in v1.0.1
*
- @description: Set text color to bright white
- @param {string} Text
- @return {string} formatted text with black color
func BrightYellowBackground ¶ added in v1.0.1
*
- @description: Set background color to bright yellow
- @param {string} Text
- @return {string} formatted text with black background
func BrightYellowText ¶ added in v1.0.1
*
- @description: Set text color to bright yellow
- @param {string} Text
- @return {string} formatted text with black color
func CyanBackground ¶
*
- @description: Set background color to cyan
- @param {string} Text
- @return {string} formatted text with black background
func CyanText ¶
*
- @description: Set text color to cyan
- @param {string} Text
- @return {string} formatted text with black color
func GrayBackground ¶ added in v1.0.1
*
- @description: Set background color to gray
- @param {string} Text
- @return {string} formatted text with black background
func GrayText ¶ added in v1.0.1
*
- @description: Set text color to gray
- @param {string} Text
- @return {string} formatted text with black color
func GreenBackground ¶
*
- @description: Set background color to green
- @param {string} Text
- @return {string} formatted text with black background
func GreenText ¶
*
- @description: Set text color to green
- @param {string} Text
- @return {string} formatted text with black color
func MagentaBackground ¶
*
- @description: Set background color to magenta
- @param {string} Text
- @return {string} formatted text with black background
func MagentaText ¶
*
- @description: Set text color to magenta
- @param {string} Text
- @return {string} formatted text with black color
func RedBackground ¶
*
- @description: Set background color to red
- @param {string} Text
- @return {string} formatted text with black background
func RedText ¶
*
- @description: Set text color to red
- @param {string} Text
- @return {string} formatted text with red color
func Remove ¶
*
- @description: remove color from text
- @param {string} Text colorized text that needs to be cleaned
- @return {string} cleaned text without color codes
func Set ¶
*
- @description: set color for text
- @param {string} Text Text that needs color added
- @param {int} Config
- @param {int} BackgroundColor
- @param {int} TextColor
- @return {string} formatted text with color
func WhiteBackground ¶
*
- @description: Set background color to white
- @param {string} Text
- @return {string} formatted text with black background
func WhiteText ¶
*
- @description: Set text color to white
- @param {string} Text
- @return {string} formatted text with black color
func YellowBackground ¶
*
- @description: Set background color to yellow
- @param {string} Text
- @return {string} formatted text with black background
func YellowText ¶
*
- @description: Set text color to yellow
- @param {string} Text
- @return {string} formatted text with black color
Types ¶
This section is empty.