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-07 11:40:58 * @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-07 11:12:48 * @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 CyanBackground(Text string) string
- func CyanText(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 )
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 )
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 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 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.