Source File
color.go
Belonging Package
github.com/gofiber/fiber/v2
// ⚡️ Fiber is an Express inspired web framework written in Go with ☕️// 🤖 Github Repository: https://github.com/gofiber/fiber// 📌 API Documentation: https://docs.gofiber.iopackage fiber// Colors is a struct to define custom colors for Fiber app and middlewares.type Colors struct {// Black color.//// Optional. Default: "\u001b[90m"Black string// Red color.//// Optional. Default: "\u001b[91m"Red string// Green color.//// Optional. Default: "\u001b[92m"Green string// Yellow color.//// Optional. Default: "\u001b[93m"Yellow string// Blue color.//// Optional. Default: "\u001b[94m"Blue string// Magenta color.//// Optional. Default: "\u001b[95m"Magenta string// Cyan color.//// Optional. Default: "\u001b[96m"Cyan string// White color.//// Optional. Default: "\u001b[97m"White string// Reset color.//// Optional. Default: "\u001b[0m"Reset string}// DefaultColors Default color codesvar DefaultColors = Colors{Black: "\u001b[90m",Red: "\u001b[91m",Green: "\u001b[92m",Yellow: "\u001b[93m",Blue: "\u001b[94m",Magenta: "\u001b[95m",Cyan: "\u001b[96m",White: "\u001b[97m",Reset: "\u001b[0m",}// defaultColors is a function to override default colors to configfunc defaultColors( Colors) Colors {if .Black == "" {.Black = DefaultColors.Black}if .Red == "" {.Red = DefaultColors.Red}if .Green == "" {.Green = DefaultColors.Green}if .Yellow == "" {.Yellow = DefaultColors.Yellow}if .Blue == "" {.Blue = DefaultColors.Blue}if .Magenta == "" {.Magenta = DefaultColors.Magenta}if .Cyan == "" {.Cyan = DefaultColors.Cyan}if .White == "" {.White = DefaultColors.White}if .Reset == "" {.Reset = DefaultColors.Reset}return}
![]() |
The pages are generated with Golds v0.6.7. (GOOS=linux GOARCH=amd64) Golds is a Go 101 project developed by Tapir Liu. PR and bug reports are welcome and can be submitted to the issue list. Please follow @Go100and1 (reachable from the left QR code) to get the latest news of Golds. |