pax_global_header00006660000000000000000000000064137045557760014535gustar00rootroot0000000000000052 comment=b0e99ef2af940bc0cbb4d02ba4283fd72e6da0e4 aurora-3.0.0/000077500000000000000000000000001370455577600130265ustar00rootroot00000000000000aurora-3.0.0/.gitignore000066400000000000000000000004741370455577600150230ustar00rootroot00000000000000# Compiled Object files, Static and Dynamic libs (Shared Objects) *.o *.a *.so # Folders _obj _test # Architecture specific extensions/prefixes *.[568vq] [568vq].out *.cgo1.go *.cgo2.c _cgo_defun.c _cgo_gotypes.go _cgo_export.* _testmain.go *.exe *.test *.prof *.out # coverage cover.html # benchcmp *.cmp aurora-3.0.0/.travis.yml000066400000000000000000000003271370455577600151410ustar00rootroot00000000000000language: go go: - tip before_install: - go get github.com/axw/gocov/gocov - go get github.com/mattn/goveralls - go get golang.org/x/tools/cmd/cover script: - $HOME/gopath/bin/goveralls -service=travis-ci aurora-3.0.0/AUTHORS.md000066400000000000000000000002251370455577600144740ustar00rootroot00000000000000AUTHORS ======= - Konstantin Ivanov @logrusorgru - Mattias Eriksson @snaggen - Ousmane Traore @otraore - Simon Legner @simon04 - Sevenate @sevenate aurora-3.0.0/CHANGELOG.md000066400000000000000000000027221370455577600146420ustar00rootroot00000000000000Changes ======= --- 16:05:02 Thursday, July 2, 2020 Change license from the WTFPL to the Unlicense due to pkg.go.dev restriction. --- 15:39:40 Wednesday, April 17, 2019 - Bright background and foreground colors - 8-bit indexed colors `Index`, `BgIndex` - 24 grayscale colors `Gray`, `BgGray` - `Yellow` and `BgYellow` methods, mark Brow and BgBrown as deprecated Following specifications, correct name of the colors are yellow, but by historical reason they are called brown. Both, the `Yellow` and the `Brown` methods (including `Bg+`) represents the same colors. The Brown are leaved for backward compatibility until Go modules production release. - Additional formats + `Faint` that is opposite to the `Bold` + `DoublyUnderline` + `Fraktur` + `Italic` + `Underline` + `SlowBlink` with `Blink` alias + `RapidBlink` + `Reverse` that is alias for the `Inverse` + `Conceal` with `Hidden` alias + `CrossedOut` with `StrikeThrough` alias + `Framed` + `Encircled` + `Overlined` - Add AUTHORS.md file and change all copyright notices. - `Reset` method to create clear value. `Reset` method that replaces `Bleach` method. The `Bleach` method was marked as deprecated. --- 14:25:49 Friday, August 18, 2017 - LICENSE.md changed to LICENSE - fix email in README.md - add "no warranty" to README.md - set proper copyright date --- 16:59:28 Tuesday, November 8, 2016 - Rid out off sync.Pool - Little optimizations (very little) - Improved benchmarks --- aurora-3.0.0/LICENSE000066400000000000000000000022731370455577600140370ustar00rootroot00000000000000This is free and unencumbered software released into the public domain. Anyone is free to copy, modify, publish, use, compile, sell, or distribute this software, either in source code form or as a compiled binary, for any purpose, commercial or non-commercial, and by any means. In jurisdictions that recognize copyright laws, the author or authors of this software dedicate any and all copyright interest in the software to the public domain. We make this dedication for the benefit of the public at large and to the detriment of our heirs and successors. We intend this dedication to be an overt act of relinquishment in perpetuity of all present and future rights to this software under copyright law. THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. For more information, please refer to aurora-3.0.0/README.md000066400000000000000000000173341370455577600143150ustar00rootroot00000000000000Aurora ====== [![go.dev reference](https://img.shields.io/badge/go.dev-reference-007d9c?logo=go&logoColor=white)](https://pkg.go.dev/github.com/logrusorgru/aurora/v3?tab=doc) [![Unlicense](https://img.shields.io/badge/license-unlicense-blue.svg)](http://unlicense.org/) [![Build Status](https://travis-ci.org/logrusorgru/aurora.svg)](https://travis-ci.org/logrusorgru/aurora) [![Coverage Status](https://coveralls.io/repos/logrusorgru/aurora/badge.svg?branch=master)](https://coveralls.io/r/logrusorgru/aurora?branch=master) [![GoReportCard](https://goreportcard.com/badge/logrusorgru/aurora)](https://goreportcard.com/report/logrusorgru/aurora) [![Gitter](https://img.shields.io/badge/chat-on_gitter-46bc99.svg?logo=data:image%2Fsvg%2Bxml%3Bbase64%2CPHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIGhlaWdodD0iMTQiIHdpZHRoPSIxNCI%2BPGcgZmlsbD0iI2ZmZiI%2BPHJlY3QgeD0iMCIgeT0iMyIgd2lkdGg9IjEiIGhlaWdodD0iNSIvPjxyZWN0IHg9IjIiIHk9IjQiIHdpZHRoPSIxIiBoZWlnaHQ9IjciLz48cmVjdCB4PSI0IiB5PSI0IiB3aWR0aD0iMSIgaGVpZ2h0PSI3Ii8%2BPHJlY3QgeD0iNiIgeT0iNCIgd2lkdGg9IjEiIGhlaWdodD0iNCIvPjwvZz48L3N2Zz4%3D&logoWidth=10)](https://gitter.im/logrusorgru/aurora) Ultimate ANSI colors for Golang. The package supports Printf/Sprintf etc. ![aurora logo](https://github.com/logrusorgru/aurora/blob/master/gopher_aurora.png) # TOC - [Installation](#installation) - [Usage](#usage) + [Simple](#simple) + [Printf](#printf) + [aurora.Sprintf](#aurorasprintf) + [Enable/Disable colors](#enabledisable-colors) - [Chains](#chains) - [Colorize](#colorize) - [Grayscale](#grayscale) - [8-bit colors](#8-bit-colors) - [Supported Colors & Formats](#supported-colors--formats) + [All colors](#all-colors) + [Standard and bright colors](#standard-and-bright-colors) + [Formats are likely supported](#formats-are-likely-supported) + [Formats are likely unsupported](#formats-are-likely-unsupported) - [Limitations](#limitations) + [Windows](#windows) + [TTY](#tty) - [Licensing](#licensing) # Installation ### Version 1.x Using gopkg.in. ``` go get -u gopkg.in/logrusorgru/aurora.v1 ``` ### Version 2.x ``` go get -u github.com/logrusorgru/aurora ``` ### Go modules support, version v3+ Get ``` go get -u github.com/logrusorgru/aurora/v3 ``` The v3 was introduced to support `go.mod` and leave previous import paths as is. Currently, there is no changes between them (excluding the importpath's /v3 tail). # Test ``` go test -cover github.com/logrusorgru/aurora/v3 ``` Replace the import path with your, if it's different. # Usage ### Simple ```go package main import ( "fmt" . "github.com/logrusorgru/aurora" ) func main() { fmt.Println("Hello,", Magenta("Aurora")) fmt.Println(Bold(Cyan("Cya!"))) } ``` ![simple png](https://github.com/logrusorgru/aurora/blob/master/simple.png) ### Printf ```go package main import ( "fmt" . "github.com/logrusorgru/aurora" ) func main() { fmt.Printf("Got it %d times\n", Green(1240)) fmt.Printf("PI is %+1.2e\n", Cyan(3.14)) } ``` ![printf png](https://github.com/logrusorgru/aurora/blob/master/printf.png) ### aurora.Sprintf ```go package main import ( "fmt" . "github.com/logrusorgru/aurora" ) func main() { fmt.Println(Sprintf(Magenta("Got it %d times"), Green(1240))) } ``` ![sprintf png](https://github.com/logrusorgru/aurora/blob/master/sprintf.png) ### Enable/Disable colors ```go package main import ( "fmt" "flag" "github.com/logrusorgru/aurora" ) // colorizer var au aurora.Aurora var colors = flag.Bool("colors", false, "enable or disable colors") func init() { flag.Parse() au = aurora.NewAurora(*colors) } func main() { // use colorizer fmt.Println(au.Green("Hello")) } ``` Without flags: ![disable png](https://github.com/logrusorgru/aurora/blob/master/disable.png) With `-colors` flag: ![enable png](https://github.com/logrusorgru/aurora/blob/master/enable.png) # Chains The following samples are equal ```go x := BgMagenta(Bold(Red("x"))) ``` ```go x := Red("x").Bold().BgMagenta() ``` The second is more readable # Colorize There is `Colorize` function that allows to choose some colors and format from a side ```go func getColors() Color { // some stuff that returns appropriate colors and format } // [...] func main() { fmt.Println(Colorize("Greeting", getColors())) } ``` Less complicated example ```go x := Colorize("Greeting", GreenFg|GrayBg|BoldFm) ``` Unlike other color functions and methods (such as Red/BgBlue etc) a `Colorize` clears previous colors ```go x := Red("x").Colorize(BgGreen) // will be with green background only ``` # Grayscale ```go fmt.Println(" ", Gray(1-1, " 00-23 ").BgGray(24-1), Gray(4-1, " 03-19 ").BgGray(20-1), Gray(8-1, " 07-15 ").BgGray(16-1), Gray(12-1, " 11-11 ").BgGray(12-1), Gray(16-1, " 15-07 ").BgGray(8-1), Gray(20-1, " 19-03 ").BgGray(4-1), Gray(24-1, " 23-00 ").BgGray(1-1), ) ``` ![grayscale png](https://github.com/logrusorgru/aurora/blob/master/aurora_grayscale.png) # 8-bit colors Methods `Index` and `BgIndex` implements 8-bit colors. | Index/BgIndex | Meaning | Foreground | Background | | -------------- | --------------- | ---------- | ---------- | | 0- 7 | standard colors | 30- 37 | 40- 47 | | 8- 15 | bright colors | 90- 97 | 100-107 | | 16-231 | 216 colors | 38;5;n | 48;5;n | | 232-255 | 24 grayscale | 38;5;n | 48;5;n | # Supported colors & formats - formats + bold (1) + faint (2) + doubly-underline (21) + fraktur (20) + italic (3) + underline (4) + slow blink (5) + rapid blink (6) + reverse video (7) + conceal (8) + crossed out (9) + framed (51) + encircled (52) + overlined (53) - background and foreground colors, including bright + black + red + green + yellow (brown) + blue + magenta + cyan + white + 24 grayscale colors + 216 8-bit colors ### All colors ![linux png](https://github.com/logrusorgru/aurora/blob/master/aurora_colors_black.png) ![white png](https://github.com/logrusorgru/aurora/blob/master/aurora_colors_white.png) ### Standard and bright colors ![linux black standard png](https://github.com/logrusorgru/aurora/blob/master/aurora_black_standard.png) ![linux white standard png](https://github.com/logrusorgru/aurora/blob/master/aurora_white_standard.png) ### Formats are likely supported ![formats supported gif](https://github.com/logrusorgru/aurora/blob/master/aurora_formats.gif) ### Formats are likely unsupported ![formats rarely supported png](https://github.com/logrusorgru/aurora/blob/master/aurora_rarely_supported.png) # Limitations There is no way to represent `%T` and `%p` with colors using a standard approach ```go package main import ( "fmt" . "github.com/logrusorgru/aurora" ) func main() { r := Red("red") var i int fmt.Printf("%T %p\n", r, Green(&i)) } ``` Output will be without colors ``` aurora.value %!p(aurora.value={0xc42000a310 768 0}) ``` The obvious workaround is `Red(fmt.Sprintf("%T", some))` ### Windows The Aurora provides ANSI colors only, so there is no support for Windows. That said, there are workarounds available. Check out these comments to learn more: - [Using go-colorable](https://github.com/logrusorgru/aurora/issues/2#issuecomment-299014211). - [Using registry for Windows 10](https://github.com/logrusorgru/aurora/issues/10#issue-476361247). ### TTY The Aurora has no internal TTY detectors by design. Take a look [this comment](https://github.com/logrusorgru/aurora/issues/2#issuecomment-299030108) if you want turn on colors for a terminal only, and turn them off for a file. ### Licensing Copyright © 2016-2020 The Aurora Authors. This work is free. It comes without any warranty, to the extent permitted by applicable law. You can redistribute it and/or modify it under the terms of the the Unlicense. See the LICENSE file for more details. aurora-3.0.0/aurora.go000066400000000000000000000407701370455577600146560ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // // Package aurora implements ANSI-colors package aurora import ( "fmt" ) // An Aurora implements colorizer interface. // It also can be a non-colorizer type Aurora interface { // Reset wraps given argument returning Value // without formats and colors. Reset(arg interface{}) Value // // Formats // // // Bold or increased intensity (1). Bold(arg interface{}) Value // Faint, decreased intensity (2). Faint(arg interface{}) Value // // DoublyUnderline or Bold off, double-underline // per ECMA-48 (21). DoublyUnderline(arg interface{}) Value // Fraktur, rarely supported (20). Fraktur(arg interface{}) Value // // Italic, not widely supported, sometimes // treated as inverse (3). Italic(arg interface{}) Value // Underline (4). Underline(arg interface{}) Value // // SlowBlink, blinking less than 150 // per minute (5). SlowBlink(arg interface{}) Value // RapidBlink, blinking 150+ per minute, // not widely supported (6). RapidBlink(arg interface{}) Value // Blink is alias for the SlowBlink. Blink(arg interface{}) Value // // Reverse video, swap foreground and // background colors (7). Reverse(arg interface{}) Value // Inverse is alias for the Reverse Inverse(arg interface{}) Value // // Conceal, hidden, not widely supported (8). Conceal(arg interface{}) Value // Hidden is alias for the Conceal Hidden(arg interface{}) Value // // CrossedOut, characters legible, but // marked for deletion (9). CrossedOut(arg interface{}) Value // StrikeThrough is alias for the CrossedOut. StrikeThrough(arg interface{}) Value // // Framed (51). Framed(arg interface{}) Value // Encircled (52). Encircled(arg interface{}) Value // // Overlined (53). Overlined(arg interface{}) Value // // Foreground colors // // // Black foreground color (30) Black(arg interface{}) Value // Red foreground color (31) Red(arg interface{}) Value // Green foreground color (32) Green(arg interface{}) Value // Yellow foreground color (33) Yellow(arg interface{}) Value // Brown foreground color (33) // // Deprecated: use Yellow instead, following specification Brown(arg interface{}) Value // Blue foreground color (34) Blue(arg interface{}) Value // Magenta foreground color (35) Magenta(arg interface{}) Value // Cyan foreground color (36) Cyan(arg interface{}) Value // White foreground color (37) White(arg interface{}) Value // // Bright foreground colors // // BrightBlack foreground color (90) BrightBlack(arg interface{}) Value // BrightRed foreground color (91) BrightRed(arg interface{}) Value // BrightGreen foreground color (92) BrightGreen(arg interface{}) Value // BrightYellow foreground color (93) BrightYellow(arg interface{}) Value // BrightBlue foreground color (94) BrightBlue(arg interface{}) Value // BrightMagenta foreground color (95) BrightMagenta(arg interface{}) Value // BrightCyan foreground color (96) BrightCyan(arg interface{}) Value // BrightWhite foreground color (97) BrightWhite(arg interface{}) Value // // Other // // Index of pre-defined 8-bit foreground color // from 0 to 255 (38;5;n). // // 0- 7: standard colors (as in ESC [ 30–37 m) // 8- 15: high intensity colors (as in ESC [ 90–97 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // Index(n uint8, arg interface{}) Value // Gray from 0 to 23. Gray(n uint8, arg interface{}) Value // // Background colors // // // BgBlack background color (40) BgBlack(arg interface{}) Value // BgRed background color (41) BgRed(arg interface{}) Value // BgGreen background color (42) BgGreen(arg interface{}) Value // BgYellow background color (43) BgYellow(arg interface{}) Value // BgBrown background color (43) // // Deprecated: use BgYellow instead, following specification BgBrown(arg interface{}) Value // BgBlue background color (44) BgBlue(arg interface{}) Value // BgMagenta background color (45) BgMagenta(arg interface{}) Value // BgCyan background color (46) BgCyan(arg interface{}) Value // BgWhite background color (47) BgWhite(arg interface{}) Value // // Bright background colors // // BgBrightBlack background color (100) BgBrightBlack(arg interface{}) Value // BgBrightRed background color (101) BgBrightRed(arg interface{}) Value // BgBrightGreen background color (102) BgBrightGreen(arg interface{}) Value // BgBrightYellow background color (103) BgBrightYellow(arg interface{}) Value // BgBrightBlue background color (104) BgBrightBlue(arg interface{}) Value // BgBrightMagenta background color (105) BgBrightMagenta(arg interface{}) Value // BgBrightCyan background color (106) BgBrightCyan(arg interface{}) Value // BgBrightWhite background color (107) BgBrightWhite(arg interface{}) Value // // Other // // BgIndex of 8-bit pre-defined background color // from 0 to 255 (48;5;n). // // 0- 7: standard colors (as in ESC [ 40–47 m) // 8- 15: high intensity colors (as in ESC [100–107 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // BgIndex(n uint8, arg interface{}) Value // BgGray from 0 to 23. BgGray(n uint8, arg interface{}) Value // // Special // // Colorize removes existing colors and // formats of the argument and applies given. Colorize(arg interface{}, color Color) Value // // Support methods // // Sprintf allows to use colored format. Sprintf(format interface{}, args ...interface{}) string } // NewAurora returns a new Aurora interface that // will support or not support colors depending // the enableColors argument func NewAurora(enableColors bool) Aurora { if enableColors { return aurora{} } return auroraClear{} } // no colors type auroraClear struct{} func (auroraClear) Reset(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Bold(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Faint(arg interface{}) Value { return valueClear{arg} } func (auroraClear) DoublyUnderline(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Fraktur(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Italic(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Underline(arg interface{}) Value { return valueClear{arg} } func (auroraClear) SlowBlink(arg interface{}) Value { return valueClear{arg} } func (auroraClear) RapidBlink(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Blink(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Reverse(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Inverse(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Conceal(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Hidden(arg interface{}) Value { return valueClear{arg} } func (auroraClear) CrossedOut(arg interface{}) Value { return valueClear{arg} } func (auroraClear) StrikeThrough(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Framed(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Encircled(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Overlined(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Black(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Red(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Green(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Yellow(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Brown(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Blue(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Magenta(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Cyan(arg interface{}) Value { return valueClear{arg} } func (auroraClear) White(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightBlack(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightRed(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightGreen(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightYellow(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightBlue(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightMagenta(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightCyan(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BrightWhite(arg interface{}) Value { return valueClear{arg} } func (auroraClear) Index(_ uint8, arg interface{}) Value { return valueClear{arg} } func (auroraClear) Gray(_ uint8, arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBlack(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgRed(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgGreen(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgYellow(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrown(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBlue(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgMagenta(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgCyan(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgWhite(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightBlack(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightRed(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightGreen(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightYellow(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightBlue(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightMagenta(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightCyan(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgBrightWhite(arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgIndex(_ uint8, arg interface{}) Value { return valueClear{arg} } func (auroraClear) BgGray(_ uint8, arg interface{}) Value { return valueClear{arg} } func (auroraClear) Colorize(arg interface{}, _ Color) Value { return valueClear{arg} } func (auroraClear) Sprintf(format interface{}, args ...interface{}) string { if str, ok := format.(string); ok { return fmt.Sprintf(str, args...) } return fmt.Sprintf(fmt.Sprint(format), args...) } // colorized type aurora struct{} func (aurora) Reset(arg interface{}) Value { return Reset(arg) } func (aurora) Bold(arg interface{}) Value { return Bold(arg) } func (aurora) Faint(arg interface{}) Value { return Faint(arg) } func (aurora) DoublyUnderline(arg interface{}) Value { return DoublyUnderline(arg) } func (aurora) Fraktur(arg interface{}) Value { return Fraktur(arg) } func (aurora) Italic(arg interface{}) Value { return Italic(arg) } func (aurora) Underline(arg interface{}) Value { return Underline(arg) } func (aurora) SlowBlink(arg interface{}) Value { return SlowBlink(arg) } func (aurora) RapidBlink(arg interface{}) Value { return RapidBlink(arg) } func (aurora) Blink(arg interface{}) Value { return Blink(arg) } func (aurora) Reverse(arg interface{}) Value { return Reverse(arg) } func (aurora) Inverse(arg interface{}) Value { return Inverse(arg) } func (aurora) Conceal(arg interface{}) Value { return Conceal(arg) } func (aurora) Hidden(arg interface{}) Value { return Hidden(arg) } func (aurora) CrossedOut(arg interface{}) Value { return CrossedOut(arg) } func (aurora) StrikeThrough(arg interface{}) Value { return StrikeThrough(arg) } func (aurora) Framed(arg interface{}) Value { return Framed(arg) } func (aurora) Encircled(arg interface{}) Value { return Encircled(arg) } func (aurora) Overlined(arg interface{}) Value { return Overlined(arg) } func (aurora) Black(arg interface{}) Value { return Black(arg) } func (aurora) Red(arg interface{}) Value { return Red(arg) } func (aurora) Green(arg interface{}) Value { return Green(arg) } func (aurora) Yellow(arg interface{}) Value { return Yellow(arg) } func (aurora) Brown(arg interface{}) Value { return Brown(arg) } func (aurora) Blue(arg interface{}) Value { return Blue(arg) } func (aurora) Magenta(arg interface{}) Value { return Magenta(arg) } func (aurora) Cyan(arg interface{}) Value { return Cyan(arg) } func (aurora) White(arg interface{}) Value { return White(arg) } func (aurora) BrightBlack(arg interface{}) Value { return BrightBlack(arg) } func (aurora) BrightRed(arg interface{}) Value { return BrightRed(arg) } func (aurora) BrightGreen(arg interface{}) Value { return BrightGreen(arg) } func (aurora) BrightYellow(arg interface{}) Value { return BrightYellow(arg) } func (aurora) BrightBlue(arg interface{}) Value { return BrightBlue(arg) } func (aurora) BrightMagenta(arg interface{}) Value { return BrightMagenta(arg) } func (aurora) BrightCyan(arg interface{}) Value { return BrightCyan(arg) } func (aurora) BrightWhite(arg interface{}) Value { return BrightWhite(arg) } func (aurora) Index(index uint8, arg interface{}) Value { return Index(index, arg) } func (aurora) Gray(n uint8, arg interface{}) Value { return Gray(n, arg) } func (aurora) BgBlack(arg interface{}) Value { return BgBlack(arg) } func (aurora) BgRed(arg interface{}) Value { return BgRed(arg) } func (aurora) BgGreen(arg interface{}) Value { return BgGreen(arg) } func (aurora) BgYellow(arg interface{}) Value { return BgYellow(arg) } func (aurora) BgBrown(arg interface{}) Value { return BgBrown(arg) } func (aurora) BgBlue(arg interface{}) Value { return BgBlue(arg) } func (aurora) BgMagenta(arg interface{}) Value { return BgMagenta(arg) } func (aurora) BgCyan(arg interface{}) Value { return BgCyan(arg) } func (aurora) BgWhite(arg interface{}) Value { return BgWhite(arg) } func (aurora) BgBrightBlack(arg interface{}) Value { return BgBrightBlack(arg) } func (aurora) BgBrightRed(arg interface{}) Value { return BgBrightRed(arg) } func (aurora) BgBrightGreen(arg interface{}) Value { return BgBrightGreen(arg) } func (aurora) BgBrightYellow(arg interface{}) Value { return BgBrightYellow(arg) } func (aurora) BgBrightBlue(arg interface{}) Value { return BgBrightBlue(arg) } func (aurora) BgBrightMagenta(arg interface{}) Value { return BgBrightMagenta(arg) } func (aurora) BgBrightCyan(arg interface{}) Value { return BgBrightCyan(arg) } func (aurora) BgBrightWhite(arg interface{}) Value { return BgBrightWhite(arg) } func (aurora) BgIndex(n uint8, arg interface{}) Value { return BgIndex(n, arg) } func (aurora) BgGray(n uint8, arg interface{}) Value { return BgGray(n, arg) } func (aurora) Colorize(arg interface{}, color Color) Value { return Colorize(arg, color) } func (aurora) Sprintf(format interface{}, args ...interface{}) string { return Sprintf(format, args...) } aurora-3.0.0/aurora_black_standard.png000066400000000000000000001110471370455577600200450ustar00rootroot00000000000000PNG  IHDRG$?bKGD pHYs~tIME #~tEXtCommentCreated with GIMPW IDATxyxU?;ޛyfJ”DyA@f_EV_PVjuhEZ"ZEEPAf2AByyb˖cdNMDٯVi1֨IlR",Hx2}kHr 1fpijrڝ 3֨'ﬣ!o8jԣ%k1I䮢`lȩ!kC CE/t ,w>'2 1]׷;"Kسq={}O<׃qV ‹0[V'yB 1S>켢(K# g%1v:JH:^0,}+]yπPF8Y-8.5_"<$2zw|k!2#~˗=n7M`;N [m{+okpChg4Ç[RAdL̚oDDLiBDnt2?+84p ]$=ޯW"xYpdFr5=S\U=Pkd.A LC/#5?g+"$sqQ2؃bYB?;("R r+K68h< RtOƌm|@FN]U*l؍#&1t|Sndzj],IqXhG4 j8>E@!DiEځN,Pe#(Hf؏;kX5eNDC+8 Ny8ꨫ}(;4 TyA*.&Ѥu ^d47!w1^]ɫÒx}l jQI4\=E<4_$$Ij {Ncxgl1E(6*OZOpR[Yql6mUy|[wK_3:FfRWRWA[-R!$Q3zLz l>v&LUK٢ц#*n [K-ל`<4h81VtH:31蓢RZTyZآAÙ#2m{fD zq֖;wjA ZآA+< !Z?"XzS<7[ya4r,/MQO B[FGrQBv;_]11{3qJ ~*)σmAz,.caƣ#S[3d"o&>#5{/owyGu<StX'jlZppzX'eqk\M%f^$g $Qa:p cr0Ø5V(_UZF'UU) eb,_wbe9, S1ƭ&=a"VN*un' /Ns܆i!»uscf:7F[ίmfK [RYymd$_!>gMJf&(ud o&; mxqx:EQu|p+<=$;"CI <eܾbiB~7;~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&c?{\E5TX|T`` : #{N8߈=$t!s2B:'ot %'5 (CYBPO2'`dZ0XKLhS_% #ӠgT%Zí:订އ&6ʉHri<+*ti4C3y]4(AN.2h薴n`< MLHvifF/k7 EB[HKcҺ~ 364Qenip; L2A 2\<80  :$Djt#ESĸEo3]$ !L UHMUuqd-d-߀;s.sPQτ͑Wn9CZt9y! ,P;aurora-3.0.0/aurora_grayscale.png000066400000000000000000000121161370455577600170600ustar00rootroot00000000000000PNG  IHDR9bKGD pHYs~tIME !EUjtEXtCommentCreated with GIMPWIDATxy|nvsm6 !M8P+xR@Ђh+V*"RDbVZ+ P< RR܁p II6k7;#A"Y+](_';33yV_E!nS BH !B!B!$B!,BH !BX!B!B!,BH !BX!B!B!,B `!BX!B!,ʺOX`|UwmtS׿СW-g›Nv&_tUINiZU?YZzr2B!I !ׁU5瘹d '|c/2>[P?,dua m~$$a@''/CΧJH0co3MCt*V}~ZS3~ `foő24wC@؇ gm<oY`wgRf%UAOH<]#8ػ W/ Rr~=QC)gAΡ^S;EP jۃ[PVVW:ybɶU.m܃6]6,:IЄkحD\q+9);ά:coݰIjxk?4x}=8}U`3K%#S|h2wu#JTVq 6C96/g5EǶ{rK̤McLJ"Udb{$6W<=vQɯV3̛<~5d}]sk7wSg3ia%1gtίpR߾o%}"h1??ɪg1yF,ۗOkwrV.H YӘLV"T߯cro.c񻁼8/X(ſhz$ ߆|V/gɻxd\H6KT o~j<^eY72牾.mGo%GnRwtp>7\ Ȇ NSV/ |ibmCx_(|$|#6=nk3}`@W}=Pָ;@DROzu=;rtT.oluK*qLPr,+6ß 2=rONfh|AY2KJM:j"S)EHlb0g"y&?r^Osa?QSKc_YȒ9 gVtKG7= C".d bg7ah>yjs[s?E<%jKܿh!K پΖ]ݟ~ '#<۰I;D1&vv*\w Z؇MHdgzߖQ.ć&8;(*ӵ]891gTq_ZwGG{ (=Ց0~Kó4Zτt,fc 15Wgg;rjڿq?Z:O4`0VWpҌ|՛SOhLj12Θ*dz61{+@U5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#9^ّN;~H5;\``wж#by퇯=8E֣W싍=p &2ǟ' e<g/V;Q{Rڎ  yT-!1Z 7a̝q|J*^YT\WT+zښ3$NGbckQ_*ܑJ˄MB~q cXc.#^6wִGPbÚ_R~{-#$;{SŹEDiU~#l0"!] سdᾂLs=-~w=z؃gSřKMUO{LXˎ =% 0FR݌J.UٙפUZ{3"Cj4ȸLsopkFgZc;oYvv^e.Ui-8q\oZj?pneXcs+++++۶݆yOz'GvT-xO)Xľ 2i!Agn:f rXMZޮ;{IfE3"@B{yRY}F̪&/]%U_MÉA]Y|+mߊȟ 2??"UB"I3 FjTS)8\͈ YY+3t+x4Ƹ qO$jҭ+>OȺ˱6\PHRC CwNl[+&j[V*s[0JKFoڙ3 6~6G LwXeqswsrplߥM]V hkR_՞nU/A~lU0k|*#L{v8Vzdu,7 rcol(OSҰDe7&DPwӥ J$H\S -E%yVwc&j^ NJةFa]@S҂ܜGkQ쏆q0W޳nSBn5cyTO.T^sjǗN*#tw SlCZҰmuiXQVm<&m]:w*~;xiBү;ޖYJfm%Y% !fGy+=6jNάH "muФa|՜JI-]Dy|LWЀs[y~c%Jk ߆{qgjB)_ߚ3< e // package aurora import ( "testing" ) func isClear(v Value) bool { return v.Color() == 0 && v.tail() == 0 } func isColor(v Value, clr Color) bool { return v.Color() == clr } func isTail(v Value, tl Color) bool { return v.tail() == tl } func Test_NewAurora(t *testing.T) { if a := NewAurora(false); a == nil { t.Error("NewAurora(false) returns nil") } if a := NewAurora(true); a == nil { t.Error("NewAurora(true) returns nil") } if t.Failed() { t.FailNow() } } func Test_auroraClear_methods(t *testing.T) { a := NewAurora(false) test := func(mn string, v Value) { if !isClear(v) { t.Errorf("NewAurora(false).%s is not clear", mn) } else if str, ok := v.Value().(string); !ok { t.Errorf("NewAurora(false).%s wrong value type", mn) } else if str != "x" { t.Errorf("NewAurora(false).%s wrong value", mn) } } test("Reset", a.Reset("x")) test("Bold", a.Bold("x")) test("Faint", a.Faint("x")) test("DoublyUnderline", a.DoublyUnderline("x")) test("Fraktur", a.Fraktur("x")) test("Italic", a.Italic("x")) test("Underline", a.Underline("x")) test("SlowBlink", a.SlowBlink("x")) test("RapidBlink", a.RapidBlink("x")) test("Blink", a.Blink("x")) test("Reverse", a.Reverse("x")) test("Inverse", a.Inverse("x")) test("Conceal", a.Conceal("x")) test("Hidden", a.Hidden("x")) test("CrossedOut", a.CrossedOut("x")) test("StrikeThrough", a.StrikeThrough("x")) test("Framed", a.Framed("x")) test("Encircled", a.Encircled("x")) test("Overlined", a.Overlined("x")) test("Black", a.Black("x")) test("Red", a.Red("x")) test("Green", a.Green("x")) test("Yellow", a.Yellow("x")) test("Brown", a.Brown("x")) test("Blue", a.Blue("x")) test("Magenta", a.Magenta("x")) test("Cyan", a.Cyan("x")) test("White", a.White("x")) test("BrightBlack", a.BrightBlack("x")) test("BrightRed", a.BrightRed("x")) test("BrightGreen", a.BrightGreen("x")) test("BrightYellow", a.BrightYellow("x")) test("BrightBlue", a.BrightBlue("x")) test("BrightMagenta", a.BrightMagenta("x")) test("BrightCyan", a.BrightCyan("x")) test("BrightWhite", a.BrightWhite("x")) test("Index", a.Index(178, "x")) test("Gray", a.Gray(14, "x")) test("BgBlack", a.BgBlack("x")) test("BgRed", a.BgRed("x")) test("BgGreen", a.BgGreen("x")) test("BgYellow", a.BgYellow("x")) test("BgBrown", a.BgBrown("x")) test("BgBlue", a.BgBlue("x")) test("BgMagenta", a.BgMagenta("x")) test("BgCyan", a.BgCyan("x")) test("BgWhite", a.BgWhite("x")) test("BgBrightBlack", a.BgBrightBlack("x")) test("BgBrightRed", a.BgBrightRed("x")) test("BgBrightGreen", a.BgBrightGreen("x")) test("BgBrightYellow", a.BgBrightYellow("x")) test("BgBrightBlue", a.BgBrightBlue("x")) test("BgBrightMagenta", a.BgBrightMagenta("x")) test("BgBrightCyan", a.BgBrightCyan("x")) test("BgBrightWhite", a.BgBrightWhite("x")) test("BgIndex", a.BgIndex(187, "x")) test("BgGray", a.BgGray(15, "x")) test("Colorize", a.Colorize("x", RedFg|BlueBg|BrightBg|BoldFm)) } func Test_auroraClear_sprintf(t *testing.T) { a := NewAurora(false) if s := a.Sprintf(a.Black("x: %d"), a.Blue(2)); s != "x: 2" { t.Error("NewAurora(false).Sprintf wrong value") } if s := a.Sprintf("x: %d", a.Blue(2)); s != "x: 2" { t.Error("NewAurora(false).Sprintf wrong value") } } func Test_aurora_methods(t *testing.T) { a := NewAurora(true) test := func(mn string, v Value, clr Color) { t.Helper() if !isColor(v, clr) { t.Errorf("NewAurora(true).%s wrong color: %d", mn, v.Color()) } else if !isTail(v, 0) { t.Errorf("NewAurora(true).%s unexpected tail value", mn) } else if str, ok := v.Value().(string); !ok { t.Errorf("NewAurora(true).%s wrong value type", mn) } else if str != "x" { t.Errorf("NewAurora(true).%s wrong value", mn) } } test("Reset", a.Reset("x"), 0) test("Bold", a.Bold("x"), BoldFm) test("Faint", a.Faint("x"), FaintFm) test("DoublyUnderline", a.DoublyUnderline("x"), DoublyUnderlineFm) test("Fraktur", a.Fraktur("x"), FrakturFm) test("Italic", a.Italic("x"), ItalicFm) test("Underline", a.Underline("x"), UnderlineFm) test("SlowBlink", a.SlowBlink("x"), SlowBlinkFm) test("RapidBlink", a.RapidBlink("x"), RapidBlinkFm) test("Blink", a.Blink("x"), BlinkFm) test("Reverse", a.Reverse("x"), ReverseFm) test("Inverse", a.Inverse("x"), InverseFm) test("Conceal", a.Conceal("x"), ConcealFm) test("Hidden", a.Hidden("x"), HiddenFm) test("CrossedOut", a.CrossedOut("x"), CrossedOutFm) test("StrikeThrough", a.StrikeThrough("x"), StrikeThroughFm) test("Framed", a.Framed("x"), FramedFm) test("Encircled", a.Encircled("x"), EncircledFm) test("Overlined", a.Overlined("x"), OverlinedFm) test("Black", a.Black("x"), BlackFg) test("Red", a.Red("x"), RedFg) test("Green", a.Green("x"), GreenFg) test("Yellow", a.Yellow("x"), YellowFg) test("Brown", a.Brown("x"), BrownFg) test("Blue", a.Blue("x"), BlueFg) test("Magenta", a.Magenta("x"), MagentaFg) test("Cyan", a.Cyan("x"), CyanFg) test("White", a.White("x"), WhiteFg) test("BrightBlack", a.BrightBlack("x"), BrightFg|BlackFg) test("BrightRed", a.BrightRed("x"), BrightFg|RedFg) test("BrightGreen", a.BrightGreen("x"), BrightFg|GreenFg) test("BrightYellow", a.BrightYellow("x"), BrightFg|YellowFg) test("BrightBlue", a.BrightBlue("x"), BrightFg|BlueFg) test("BrightMagenta", a.BrightMagenta("x"), BrightFg|MagentaFg) test("BrightCyan", a.BrightCyan("x"), BrightFg|CyanFg) test("BrightWhite", a.BrightWhite("x"), BrightFg|WhiteFg) test("Index", a.Index(178, "x"), (Color(178)</' oV7O3qU@h\é2~0/!|7 JEӘx,D },e[//(wkhH׏'$?e4F^v; 'y6ld$a0|0 (_9e7 ?^l #y цj4=&_JW>{zI5y~FJ{GBa'|RxD?$ j韼F.YMQktxsڻA2'gGq۟3Ĵ)x8X XϜuL~Lѯ+iΉ⪗N۷rW9 ~g5GΜo.hdPNى;/5gPf?9S#޿y,q2@'t[:ySy$wAO JNi Wqe0?k<E*t]dv\28P1s͈4@ܸs @^{\UA 4PG|^^y_OQP QU@ ?D:2^yh&1m09r_hHzi*,fHnPHIK3Ʉ& wC:sH$RR锚3ockM a._}>F HB̝ e LݜC?cG/ ;gm=N?a6}TTɊ\YƠOkX7%T((Gҩ5P37t7]h'^2amfNN+gpޕϒF߹ebd$TAMM +tS|*ھ5a)g=P䏖$sgSH}{̕'ve{^)ܳzܾ^Wtzviќ6~+ߙ7=y16 d9:8WcFF5Gak2+HKT*&<-g!^3$& dfsϐL&y_zUq˄[oyz} y { d%(n8j_JaĻYˣ4^){  y^ʣ]h<}2{ 649}K79*0%⮧Ęf"Gqu9wʝHdkxL\Цo <)͏bb$lVƚaa7q.ww +e2?/ Pr@*߆I4وjLx$x|P#QbCKIi| |L$/9v %AُT??Xt ݕ,kEuZH3}o&І TΧpo(G*Ƴo>"ɷgĝի,jqLI߿EmJp̈z#fE/#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UTzmYq`%qpݰ2c!F,!"`Ƴ|z}<]8mvJ}*)tks/% ^bf_y崗Ht]!Kd\؏nOS2S'M\|$/e AimՁs~)@yNfMB2:9ty6Bׅ0Xƿo1wI#@#6[UW;?Oʉxn^lG$쓾>QI^KPYYI%6r ]䆟_zmn.+(Ȧa?Yy02u~%仇r?}eU"adw&{7G>,oQ~B:[.f}{n$[^N?9~KO/a u/K 0K*Z>UMzt(j+iޑ.0zzo2e 0r%TCQ͟1t"}ټJK?mU׼(O@MǷpŏ.ʒ;>'`8i@ i;РA4hР9 4h@ РA4hР9 4h@ РA4hР9 4h@ РA4hР9 4h@ РA4hР9 4\n(=/IENDB`aurora-3.0.0/bench_test.go000066400000000000000000000325411370455577600155000ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "testing" ) var ( gVal Value gVals []Value gStr string ) var ( short = "x" long = "some long and complicated string to colorize" shortf = "%s" longf = long + " %s" s18 = "%s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s %s" ) // 18 values func simpleValues(a Aurora, x string) []Value { return []Value{ a.Reset("x"), a.Bold("x"), a.Faint("x"), a.DoublyUnderline("x"), a.Fraktur("x"), a.Italic("x"), a.Underline("x"), a.SlowBlink("x"), a.RapidBlink("x"), a.Blink("x"), a.Reverse("x"), a.Inverse("x"), a.Conceal("x"), a.Hidden("x"), a.CrossedOut("x"), a.StrikeThrough("x"), a.Framed("x"), a.Encircled("x"), a.Overlined("x"), a.Black("x"), a.Red("x"), a.Green("x"), a.Yellow("x"), a.Brown("x"), a.Blue("x"), a.Magenta("x"), a.Cyan("x"), a.White("x"), a.BrightBlack("x"), a.BrightRed("x"), a.BrightGreen("x"), a.BrightYellow("x"), a.BrightBlue("x"), a.BrightMagenta("x"), a.BrightCyan("x"), a.BrightWhite("x"), a.Index(178, "x"), a.Gray(14, "x"), a.BgBlack("x"), a.BgRed("x"), a.BgGreen("x"), a.BgYellow("x"), a.BgBrown("x"), a.BgBlue("x"), a.BgMagenta("x"), a.BgCyan("x"), a.BgWhite("x"), a.BgBrightBlack("x"), a.BgBrightRed("x"), a.BgBrightGreen("x"), a.BgBrightYellow("x"), a.BgBrightBlue("x"), a.BgBrightMagenta("x"), a.BgBrightCyan("x"), a.BgBrightWhite("x"), a.BgIndex(187, "x"), a.BgGray(15, "x"), } } // 18 values func complexValues(a Aurora, x string) []Value { var allFormats = func(val Value) Value { return val.Bold().DoublyUnderline().Fraktur().Blink().Italic(). Underline().Blink().Reverse().Conceal().CrossedOut().Framed(). Encircled().Overlined() } return []Value{ allFormats(a.Reset(x).BrightBlack().BgBrightWhite()), allFormats(a.Bold(x).BrightRed().BgBrightMagenta()), allFormats(a.Faint(x).Index(128).BgIndex(135)), allFormats(a.DoublyUnderline(x).Gray(13).BgRed()), allFormats(a.Fraktur(x).BgYellow().Black()), allFormats(a.Italic(x).Red().BgBrightMagenta()), allFormats(a.Underline(x).BrightBlue().BgYellow()), allFormats(a.SlowBlink(x).BrightCyan().BgBrightRed()), allFormats(a.RapidBlink(x).Green().BgYellow()), allFormats(a.Blink(x).Red().BgBlack()), allFormats(a.Reverse(x).BgBlack().White()), allFormats(a.Inverse(x).White().BgBlack()), allFormats(a.Conceal(x).BrightBlue().BgYellow()), allFormats(a.Hidden(x).BrightYellow().BgBrightGreen()), allFormats(a.CrossedOut(x).BrightGreen()), allFormats(a.StrikeThrough(x).Index(128)), allFormats(a.Framed(x).Index(128).BgIndex(55)), allFormats(a.Encircled(x).Index(216).BgIndex(20)), allFormats(a.Overlined(x).Index(224).BgIndex(15)), allFormats(a.Black(x).BgBrightRed()), allFormats(a.Red(x).BgBrightRed()), allFormats(a.Green(x).BgBrightRed()), allFormats(a.Yellow(x).BgBrightRed()), allFormats(a.Brown(x).BgBrightRed()), allFormats(a.Blue(x).BgBrightRed()), allFormats(a.Magenta(x).BgBrightRed()), allFormats(a.Cyan(x).BgBrightRed()), allFormats(a.White(x).BgBrightRed()), allFormats(a.BrightBlack(x).BgBrightRed()), allFormats(a.BrightRed(x).BgBrightRed()), allFormats(a.BrightGreen(x).BgBrightRed()), allFormats(a.BrightYellow(x).BgWhite()), allFormats(a.BrightBlue(x).BgMagenta()), allFormats(a.BrightMagenta(x).BgGreen()), allFormats(a.BrightCyan(x).BgRed()), allFormats(a.BrightWhite(x).BgBlack()), allFormats(a.Index(178, x).BgGray(1)), allFormats(a.Gray(14, x).BgIndex(89)), allFormats(a.BgBlack(x).BrightBlack()), allFormats(a.BgRed(x).BrightRed()), allFormats(a.BgGreen(x).BrightGreen()), allFormats(a.BgYellow(x).BrightYellow()), allFormats(a.BgBrown(x).BrightYellow()), allFormats(a.BgBlue(x).BrightBlue()), allFormats(a.BgMagenta(x).BrightMagenta()), allFormats(a.BgCyan(x).BrightCyan()), allFormats(a.BgWhite(x).BrightWhite()), allFormats(a.BgBrightBlack(x).Black()), allFormats(a.BgBrightRed(x).Red()), allFormats(a.BgBrightGreen(x).Green()), allFormats(a.BgBrightYellow(x).Yellow()), allFormats(a.BgBrightBlue(x).Blue()), allFormats(a.BgBrightMagenta(x).Magenta()), allFormats(a.BgBrightCyan(x).Cyan()), allFormats(a.BgBrightWhite(x).White()), allFormats(a.BgIndex(187, x).Index(16)), allFormats(a.BgGray(15, x).Gray(0)), } } func benchSimpleValue(b *testing.B, a Aurora, x string) { b.ResetTimer() for i := 0; i < b.N; i++ { gVals = simpleValues(a, x) } b.ReportAllocs() } func benchComplexValue(b *testing.B, a Aurora, x string) { b.ResetTimer() for i := 0; i < b.N; i++ { gVals = complexValues(a, x) } b.ReportAllocs() } func benchValueString(b *testing.B, vals []Value) { b.ResetTimer() for i := 0; i < b.N; i++ { for j := 0; j < len(vals); j++ { // TODO: range and allocs ? gStr = vals[j].String() } } b.ReportAllocs() } func benchSprintf(b *testing.B, a Aurora, format interface{}, args ...interface{}) { b.ResetTimer() for i := 0; i < b.N; i++ { gStr = a.Sprintf(format, args...) } b.ReportAllocs() } func toInterfaces(vals []Value) []interface{} { r := make([]interface{}, 0, len(vals)) for _, val := range vals { r = append(r, val) } return r } func auroraBench(a Aurora, b *testing.B) { // a.Red("...") b.Run("simple value", func(b *testing.B) { b.Run("short", func(b *testing.B) { benchSimpleValue(b, a, short) }) b.Run("long", func(b *testing.B) { benchSimpleValue(b, a, long) }) }) // a.Red("...").BgRed().Bold().Inverse() b.Run("complex value", func(b *testing.B) { b.Run("short", func(b *testing.B) { benchComplexValue(b, a, short) }) b.Run("long", func(b *testing.B) { benchComplexValue(b, a, long) }) }) // a.Red("...").String() b.Run("simple value string", func(b *testing.B) { b.Run("short", func(b *testing.B) { benchValueString(b, simpleValues(a, short)) }) b.Run("long", func(b *testing.B) { benchValueString(b, simpleValues(a, long)) }) }) // a.Red("...").BgRed().Bold().Inverse().String() b.Run("complex value string", func(b *testing.B) { b.Run("short", func(b *testing.B) { benchValueString(b, complexValues(a, short)) }) b.Run("long", func(b *testing.B) { benchValueString(b, complexValues(a, long)) }) }) // Sprintf b.Run("sprintf", func(b *testing.B) { // a.Sprintf(noString("... %s"), "x") b.Run("no-string", func(b *testing.B) { b.Run("short format", func(b *testing.B) { benchSprintf(b, a, noString(shortf), "x") }) b.Run("long format", func(b *testing.B) { benchSprintf(b, a, noString(longf), "x") }) }) // a.Sprintf("... %s", "x") b.Run("usual", func(b *testing.B) { b.Run("short format", func(b *testing.B) { benchSprintf(b, a, shortf, "x") }) b.Run("long format", func(b *testing.B) { benchSprintf(b, a, longf, "x") }) }) // // vary arguments // b.Run("simple arg", func(b *testing.B) { // string %s, a.Red("x") (one-color single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, "%s", a.Red("x")) }) // string %s %s ..., a.Red("x"), ... (one-color many arguments) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, s18, toInterfaces(simpleValues(a, "x"))...) }) }) b.Run("complex arg", func(b *testing.B) { // string %s, a.Red("x").BgRed()... (many colors single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, "%s", a.Red("x").BgGray(5).Bold().Inverse()) }) // string %s %s..., a.Red("x").BgRed()..., ... (many colors 18 args) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, s18, toInterfaces(complexValues(a, "x"))...) }) }) // // same with colored format // b.Run("simple arg (simple format)", func(b *testing.B) { // string %s, a.Red("x") (one-color single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, a.Magenta("%s"), a.Red("x")) }) // string %s %s ..., a.Red("x"), ... (one-color many arguments) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, a.Magenta(s18), toInterfaces(simpleValues(a, "x"))...) }) }) b.Run("complex arg (simple format)", func(b *testing.B) { // string %s, a.Red("x").BgRed()... (many colors single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, a.Magenta("%s"), a.Red("x").BgGray(5).Bold().Inverse()) }) // string %s %s..., a.Red("x").BgRed()..., ... (many colors 18 args) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, a.Magenta(s18), toInterfaces(complexValues(a, "x"))...) }) }) // // same with complex format // b.Run("simple arg (complex format)", func(b *testing.B) { // string %s, a.Red("x") (one-color single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, a.Magenta("%s").BgGray(5).Bold().Inverse(), a.Red("x")) }) // string %s %s ..., a.Red("x"), ... (one-color many arguments) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, a.Magenta(s18).BgGray(5).Bold().Inverse(), toInterfaces(simpleValues(a, "x"))...) }) }) b.Run("complex arg (complex format)", func(b *testing.B) { // string %s, a.Red("x").BgRed()... (many colors single argument) b.Run("1 arg", func(b *testing.B) { benchSprintf(b, a, a.Magenta("%s").BgGray(5).Bold().Inverse(), a.Red("x").BgGray(5).Bold().Inverse()) }) // string %s %s..., a.Red("x").BgRed()..., ... (many colors 18 args) b.Run("18 args", func(b *testing.B) { benchSprintf(b, a, a.Magenta(s18).BgGray(5).Bold().Inverse(), toInterfaces(complexValues(a, "x"))...) }) }) }) } func Benchmark_auroraClear(b *testing.B) { a := NewAurora(false) auroraBench(a, b) } // create a value func Benchmark_aurora(b *testing.B) { a := NewAurora(true) auroraBench(a, b) } // Wrap functions func Benchmark_wrap(b *testing.B) { ary := []struct { name string fn func(interface{}) Value }{ {"Reset", Reset}, {"Bold", Bold}, {"Faint", Faint}, {"DoublyUnderline", DoublyUnderline}, {"Fraktur", Fraktur}, {"Italic", Italic}, {"Underline", Underline}, {"SlowBlink", SlowBlink}, {"RapidBlink", RapidBlink}, {"Blink", Blink}, {"Reverse", Reverse}, {"Inverse", Inverse}, {"Conceal", Conceal}, {"Hidden", Hidden}, {"CrossedOut", CrossedOut}, {"StrikeThrough", StrikeThrough}, {"Framed", Framed}, {"Encircled", Encircled}, {"Overlined", Overlined}, {"Black", Black}, {"Red", Red}, {"Green", Green}, {"Yellow", Yellow}, {"Brown", Brown}, {"Blue", Blue}, {"Magenta", Magenta}, {"Cyan", Cyan}, {"White", White}, {"BrightBlack", BrightBlack}, {"BrightRed", BrightRed}, {"BrightGreen", BrightGreen}, {"BrightYellow", BrightYellow}, {"BrightBlue", BrightBlue}, {"BrightMagenta", BrightMagenta}, {"BrightCyan", BrightCyan}, {"BrightWhite", BrightWhite}, {"BgBlack", BgBlack}, {"BgRed", BgRed}, {"BgGreen", BgGreen}, {"BgYellow", BgYellow}, {"BgBrown", BgBrown}, {"BgBlue", BgBlue}, {"BgMagenta", BgMagenta}, {"BgCyan", BgCyan}, {"BgWhite", BgWhite}, {"BgBrightBlack", BgBrightBlack}, {"BgBrightRed", BgBrightRed}, {"BgBrightGreen", BgBrightGreen}, {"BgBrightYellow", BgBrightYellow}, {"BgBrightBlue", BgBrightBlue}, {"BgBrightMagenta", BgBrightMagenta}, {"BgBrightCyan", BgBrightCyan}, {"BgBrightWhite", BgBrightWhite}, } for _, wf := range ary { b.Run(wf.name, func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = wf.fn(0) } b.ReportAllocs() }) } b.Run("Colorize", func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = Colorize(0, RedFg) } b.ReportAllocs() }) b.Run("Index", func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = Index(216, 0) } b.ReportAllocs() }) b.Run("BgIndex", func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = Index(216, 0) } b.ReportAllocs() }) b.Run("Gray", func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = Gray(15, 0) } b.ReportAllocs() }) b.Run("BgGray", func(b *testing.B) { for i := 0; i < b.N; i++ { gVal = BgGray(15, 0) } b.ReportAllocs() }) } aurora-3.0.0/color.go000066400000000000000000000231011370455577600144700ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora // A Color type is a color. It can contain // one background color, one foreground color // and a format, including ideogram related // formats. type Color uint /* Developer note. The int type is architecture depended and can be represented as int32 or int64. Thus, we can use 32-bits only to be fast and cross-platform. All supported formats requires 14 bits. It is first 14 bits. A foreground color requires 8 bit + 1 bit (presence flag). And the same for background color. The Color representations [ bg 8 bit ] [fg 8 bit ] [ fg/bg 2 bits ] [ fm 14 bits ] https://play.golang.org/p/fq2zcNstFoF */ // Special formats const ( BoldFm Color = 1 << iota // 1 FaintFm // 2 ItalicFm // 3 UnderlineFm // 4 SlowBlinkFm // 5 RapidBlinkFm // 6 ReverseFm // 7 ConcealFm // 8 CrossedOutFm // 9 FrakturFm // 20 DoublyUnderlineFm // 21 or bold off for some systems FramedFm // 51 EncircledFm // 52 OverlinedFm // 53 InverseFm = ReverseFm // alias to ReverseFm BlinkFm = SlowBlinkFm // alias to SlowBlinkFm HiddenFm = ConcealFm // alias to ConcealFm StrikeThroughFm = CrossedOutFm // alias to CrossedOutFm maskFm = BoldFm | FaintFm | ItalicFm | UnderlineFm | SlowBlinkFm | RapidBlinkFm | ReverseFm | ConcealFm | CrossedOutFm | FrakturFm | DoublyUnderlineFm | FramedFm | EncircledFm | OverlinedFm flagFg Color = 1 << 14 // presence flag (14th bit) flagBg Color = 1 << 15 // presence flag (15th bit) shiftFg = 16 // shift for foreground (starting from 16th bit) shiftBg = 24 // shift for background (starting from 24th bit) ) // Foreground colors and related formats const ( // 8 bits // [ 0; 7] - 30-37 // [ 8; 15] - 90-97 // [ 16; 231] - RGB // [232; 255] - grayscale BlackFg Color = (iota << shiftFg) | flagFg // 30, 90 RedFg // 31, 91 GreenFg // 32, 92 YellowFg // 33, 93 BlueFg // 34, 94 MagentaFg // 35, 95 CyanFg // 36, 96 WhiteFg // 37, 97 BrightFg Color = ((1 << 3) << shiftFg) | flagFg // -> 90 // the BrightFg itself doesn't represent // a color, thus it has not flagFg // 5 bits // BrownFg represents brown foreground color. // // Deprecated: use YellowFg instead, following specifications BrownFg = YellowFg // maskFg = (0xff << shiftFg) | flagFg ) // Background colors and related formats const ( // 8 bits // [ 0; 7] - 40-47 // [ 8; 15] - 100-107 // [ 16; 231] - RGB // [232; 255] - grayscale BlackBg Color = (iota << shiftBg) | flagBg // 40, 100 RedBg // 41, 101 GreenBg // 42, 102 YellowBg // 43, 103 BlueBg // 44, 104 MagentaBg // 45, 105 CyanBg // 46, 106 WhiteBg // 47, 107 BrightBg Color = ((1 << 3) << shiftBg) | flagBg // -> 100 // the BrightBg itself doesn't represent // a color, thus it has not flagBg // 5 bits // BrownBg represents brown foreground color. // // Deprecated: use YellowBg instead, following specifications BrownBg = YellowBg // maskBg = (0xff << shiftBg) | flagBg ) const ( availFlags = "-+# 0" esc = "\033[" clear = esc + "0m" ) // IsValid returns true always // // Deprecated: don't use this method anymore func (c Color) IsValid() bool { return true } // Nos returns string like 1;7;31;45. It // may be an empty string for empty color. // If the zero is true, then the string // is prepended with 0; func (c Color) Nos(zero bool) string { return string(c.appendNos(make([]byte, 0, 59), zero)) } func appendCond(bs []byte, cond, semi bool, vals ...byte) []byte { if !cond { return bs } return appendSemi(bs, semi, vals...) } // if the semi is true, then prepend with semicolon func appendSemi(bs []byte, semi bool, vals ...byte) []byte { if semi { bs = append(bs, ';') } return append(bs, vals...) } func itoa(t byte) string { var ( a [3]byte j = 2 ) for i := 0; i < 3; i, j = i+1, j-1 { a[j] = '0' + t%10 if t = t / 10; t == 0 { break } } return string(a[j:]) } func (c Color) appendFg(bs []byte, zero bool) []byte { if zero || c&maskFm != 0 { bs = append(bs, ';') } // 0- 7 : 30-37 // 8-15 : 90-97 // > 15 : 38;5;val switch fg := (c & maskFg) >> shiftFg; { case fg <= 7: // '3' and the value itself bs = append(bs, '3', '0'+byte(fg)) case fg <= 15: // '9' and the value itself bs = append(bs, '9', '0'+byte(fg&^0x08)) // clear bright flag default: bs = append(bs, '3', '8', ';', '5', ';') bs = append(bs, itoa(byte(fg))...) } return bs } func (c Color) appendBg(bs []byte, zero bool) []byte { if zero || c&(maskFm|maskFg) != 0 { bs = append(bs, ';') } // 0- 7 : 40- 47 // 8-15 : 100-107 // > 15 : 48;5;val switch fg := (c & maskBg) >> shiftBg; { case fg <= 7: // '3' and the value itself bs = append(bs, '4', '0'+byte(fg)) case fg <= 15: // '1', '0' and the value itself bs = append(bs, '1', '0', '0'+byte(fg&^0x08)) // clear bright flag default: bs = append(bs, '4', '8', ';', '5', ';') bs = append(bs, itoa(byte(fg))...) } return bs } func (c Color) appendFm9(bs []byte, zero bool) []byte { bs = appendCond(bs, c&ItalicFm != 0, zero || c&(BoldFm|FaintFm) != 0, '3') bs = appendCond(bs, c&UnderlineFm != 0, zero || c&(BoldFm|FaintFm|ItalicFm) != 0, '4') // don't combine slow and rapid blink using only // on of them, preferring slow blink if c&SlowBlinkFm != 0 { bs = appendSemi(bs, zero || c&(BoldFm|FaintFm|ItalicFm|UnderlineFm) != 0, '5') } else if c&RapidBlinkFm != 0 { bs = appendSemi(bs, zero || c&(BoldFm|FaintFm|ItalicFm|UnderlineFm) != 0, '6') } // including 1-2 const mask6i = BoldFm | FaintFm | ItalicFm | UnderlineFm | SlowBlinkFm | RapidBlinkFm bs = appendCond(bs, c&ReverseFm != 0, zero || c&(mask6i) != 0, '7') bs = appendCond(bs, c&ConcealFm != 0, zero || c&(mask6i|ReverseFm) != 0, '8') bs = appendCond(bs, c&CrossedOutFm != 0, zero || c&(mask6i|ReverseFm|ConcealFm) != 0, '9') return bs } // append 1;3;38;5;216 like string that represents ANSI // color of the Color; the zero argument requires // appending of '0' before to reset previous format // and colors func (c Color) appendNos(bs []byte, zero bool) []byte { if zero { bs = append(bs, '0') // reset previous } // formats // if c&maskFm != 0 { // 1-2 // don't combine bold and faint using only on of them, preferring bold if c&BoldFm != 0 { bs = appendSemi(bs, zero, '1') } else if c&FaintFm != 0 { bs = appendSemi(bs, zero, '2') } // 3-9 const mask9 = ItalicFm | UnderlineFm | SlowBlinkFm | RapidBlinkFm | ReverseFm | ConcealFm | CrossedOutFm if c&mask9 != 0 { bs = c.appendFm9(bs, zero) } // 20-21 const ( mask21 = FrakturFm | DoublyUnderlineFm mask9i = BoldFm | FaintFm | mask9 ) if c&mask21 != 0 { bs = appendCond(bs, c&FrakturFm != 0, zero || c&mask9i != 0, '2', '0') bs = appendCond(bs, c&DoublyUnderlineFm != 0, zero || c&(mask9i|FrakturFm) != 0, '2', '1') } // 50-53 const ( mask53 = FramedFm | EncircledFm | OverlinedFm mask21i = mask9i | mask21 ) if c&mask53 != 0 { bs = appendCond(bs, c&FramedFm != 0, zero || c&mask21i != 0, '5', '1') bs = appendCond(bs, c&EncircledFm != 0, zero || c&(mask21i|FramedFm) != 0, '5', '2') bs = appendCond(bs, c&OverlinedFm != 0, zero || c&(mask21i|FramedFm|EncircledFm) != 0, '5', '3') } } // foreground if c&maskFg != 0 { bs = c.appendFg(bs, zero) } // background if c&maskBg != 0 { bs = c.appendBg(bs, zero) } return bs } aurora-3.0.0/color_test.go000066400000000000000000000100251370455577600155300ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "strconv" "testing" ) func TestColor_Nos(t *testing.T) { for _, zero := range []bool{ false, true, } { for i, val := range []struct { Nos string Color Color }{ {"1", BoldFm}, {"2", FaintFm}, {"3", ItalicFm}, {"4", UnderlineFm}, {"5", SlowBlinkFm}, {"6", RapidBlinkFm}, {"7", ReverseFm}, {"8", ConcealFm}, {"9", CrossedOutFm}, {"20", FrakturFm}, {"21", DoublyUnderlineFm}, {"51", FramedFm}, {"52", EncircledFm}, {"53", OverlinedFm}, {"30", BlackFg}, {"31", RedFg}, {"32", GreenFg}, {"33", YellowFg}, {"34", BlueFg}, {"35", MagentaFg}, {"36", CyanFg}, {"37", WhiteFg}, {"90", BlackFg | BrightFg}, {"91", RedFg | BrightFg}, {"92", GreenFg | BrightFg}, {"93", YellowFg | BrightFg}, {"94", BlueFg | BrightFg}, {"95", MagentaFg | BrightFg}, {"96", CyanFg | BrightFg}, {"97", WhiteFg | BrightFg}, {"90", BrightFg}, {"40", BlackBg}, {"41", RedBg}, {"42", GreenBg}, {"43", YellowBg}, {"44", BlueBg}, {"45", MagentaBg}, {"46", CyanBg}, {"47", WhiteBg}, {"100", BlackBg | BrightBg}, {"101", RedBg | BrightBg}, {"102", GreenBg | BrightBg}, {"103", YellowBg | BrightBg}, {"104", BlueBg | BrightBg}, {"105", MagentaBg | BrightBg}, {"106", CyanBg | BrightBg}, {"107", WhiteBg | BrightBg}, {"100", BrightBg}, // bold and faint {"1", BoldFm | FaintFm}, // slow blink and rapid blink {"5", SlowBlinkFm | RapidBlinkFm}, // index {"38;5;100", (100 << shiftFg) | flagFg}, {"48;5;100", (100 << shiftBg) | flagBg}, // longest combination {"1;3;4;5;7;8;9;20;21;51;52;53;38;5;123;48;5;231", BoldFm | FaintFm | ItalicFm | UnderlineFm | SlowBlinkFm | RapidBlinkFm | ReverseFm | ConcealFm | CrossedOutFm | FrakturFm | DoublyUnderlineFm | FramedFm | EncircledFm | OverlinedFm | Color(123)<9PHw>X,|yEQͦjy5Lxj`0P*Z'l6[VT*eZWH$Z.kÁaD"AQz<_ IO^w(j0\wSbX\ H0 AbAeYtz<Ricp`Xwlv<U*d2&P(%nkbp88N'PXfhj|v8W*~:V`0X,>$tz^zNe٤%JH$$I Z<ɐ$i69h4/^k>Tr܁z]>IENDB`aurora-3.0.0/enable.png000066400000000000000000000011361370455577600147630ustar00rootroot00000000000000PNG  IHDR+\ pHYs+IDATH?kAߙ[v2sIB QD, XE, *)lD&Xm + A;9Pc bc;{3+{jIjym3żٔ$_Ap3Wbsd#@ ˮ{-|Dt(4YβCU#Бٵ⩶nR'ۦGzS_@3m&| 눕}Y:d=tsp̱lJ Mq9c}:ֲ)3qА$E6D JS{JJ1'ҘnHG`ui8>eӫGyOEIENDB`aurora-3.0.0/example_test.go000066400000000000000000000032051370455577600160470ustar00rootroot00000000000000// // Copyright (c) 2016-2019 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE // Version 2, December 2004 // // Copyright (C) 2004 Sam Hocevar // // Everyone is permitted to copy and distribute verbatim or modified // copies of this license document, and changing it is allowed as long // as the name is changed. // // DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE // TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION // // 0. You just DO WHAT THE FUCK YOU WANT TO. // package aurora import ( "fmt" ) func ExampleRed() { fmt.Println("value exceeds min-threshold:", Red(3.14)) // Output: value exceeds min-threshold: 3.14 } func ExampleBold() { fmt.Println("value:", Bold(Green(99))) // Output: value: 99 } func ExampleNewAurora_no_colors() { a := NewAurora(false) fmt.Println(a.Red("Not red")) // Output: Not red } func ExampleNewAurora_colors() { a := NewAurora(true) fmt.Println(a.Red("Red")) // Output: Red } func Example_printf() { fmt.Printf("%d %s", Blue(100), BgBlue("cats")) // Output: 100 cats } func ExampleSprintf() { fmt.Print( Sprintf( Blue("we've got %d cats, but want %d"), // <- blue format Cyan(5), Bold(Magenta(25)), ), ) // Output: we've got 5 cats, but want 25 } aurora-3.0.0/go.mod000066400000000000000000000000611370455577600141310ustar00rootroot00000000000000module github.com/logrusorgru/aurora/v3 go 1.14 aurora-3.0.0/gopher_aurora.png000066400000000000000000000400031370455577600163660ustar00rootroot00000000000000PNG  IHDR":9 pHYs   IDATxw\ŕ/~NU54 !l2lx^u]/6]x?e1oINIJ(!ir|CUԣA}>soߪo=Nǜm"6MLjTAW~!.}bYetJ\CYxFf0S :'E3z\CjƁ↿N.uh߭ؑ6!Gܗ5\5s˪SMtĐ9{Ob{w1M5]JX`{Z*xRSZp(O]E ͞P߱vVwMVBu䬬/ R$ZJ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printf.go000066400000000000000000000045651370455577600150540ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "fmt" ) // Sprintf allows to use Value as format. For example // // v := Sprintf(Red("total: +3.5f points"), Blue(3.14)) // // In this case "total:" and "points" will be red, but // 3.14 will be blue. But, in another example // // v := Sprintf(Red("total: +3.5f points"), 3.14) // // full string will be red. And no way to clear 3.14 to // default format and color func Sprintf(format interface{}, args ...interface{}) string { switch ft := format.(type) { case string: return fmt.Sprintf(ft, args...) case Value: for i, v := range args { if val, ok := v.(Value); ok { args[i] = val.setTail(ft.Color()) continue } } return fmt.Sprintf(ft.String(), args...) } // unknown type of format (we hope it's a string) return fmt.Sprintf(fmt.Sprint(format), args...) } aurora-3.0.0/sprintf.png000066400000000000000000000035021370455577600152210ustar00rootroot00000000000000PNG  IHDR d pHYs+IDATXV}lr㳃h P-P蔶" a@' Zm4(Zu HHQjӺ˒nL4miTP*diZ$YB1l{,$Ïy}?<czN_g _<_kaA/}[<-leReeJ>!nyZLy T~^|>MK*.}>)/x OR%w#lI}~i-R2haW^G( z%c9eE:K~r+Pq 8WNHu=t{}t%``̊I w7q }l> rpWE:!Bn_z_ J͋="SDṷt)y%iBe;EW4{ Mqh xG/@Io_beYvvk ~?aN iCUlUOO]7#@BV~DHDG? b8o^,-n\7\ì\ĬfVH01frw HRN@_q6rR&ŔҥS|6x=&ظf\3\N-Oa:0@|`Uϫ}\~6rȤq[~Z|2jZ c"f{.9ŬXŭ2Lϋ1,& 3SbQKp;X3@R 7 !̀Cgl \% qP.JSKXNRnj199ޛer]Mضߌ'?>X  i޴[ 0 ܆Z)3>?mqu^_X;n#塿A.x x._ubP⟉^,QoqпЭ?s9:ȡ3W7p:Gt)]ڠjle WQ7ĭǚ:%Rj}(<#<#?:NTiIENDB`aurora-3.0.0/sprintf_test.go000066400000000000000000000037121370455577600161040ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "testing" ) type noString string func Test_Sprintf(t *testing.T) { //b := Black("x") v := Sprintf(noString("delta: +%d"), 3) if v != "delta: +3" { t.Error("Sprintf: wrong result") } v = Sprintf(Red("deltas: +%d, %d, %d points"), 3, 5, 9) want := "\033[31mdeltas: +3, 5, 9 points\033[0m" if v != want { t.Errorf("Sprintf: want: %q, got %q", want, v) } } aurora-3.0.0/value.go000066400000000000000000000444361370455577600145040ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "fmt" "strconv" "unicode/utf8" ) // A Value represents any printable value // with it's color type Value interface { // String returns string with colors. If there are any color // or format the string will be terminated with \033[0m fmt.Stringer // Format implements fmt.Formatter interface fmt.Formatter // Color returns value's color Color() Color // Value returns value's value (welcome to the tautology club) Value() interface{} // internals tail() Color setTail(Color) Value // Bleach returns copy of original value without colors // // Deprecated: use Reset instead. Bleach() Value // Reset colors and formats Reset() Value // // Formats // // // Bold or increased intensity (1). Bold() Value // Faint, decreased intensity, reset the Bold (2). Faint() Value // // DoublyUnderline or Bold off, double-underline // per ECMA-48 (21). It depends. DoublyUnderline() Value // Fraktur, rarely supported (20). Fraktur() Value // // Italic, not widely supported, sometimes // treated as inverse (3). Italic() Value // Underline (4). Underline() Value // // SlowBlink, blinking less than 150 // per minute (5). SlowBlink() Value // RapidBlink, blinking 150+ per minute, // not widely supported (6). RapidBlink() Value // Blink is alias for the SlowBlink. Blink() Value // // Reverse video, swap foreground and // background colors (7). Reverse() Value // Inverse is alias for the Reverse Inverse() Value // // Conceal, hidden, not widely supported (8). Conceal() Value // Hidden is alias for the Conceal Hidden() Value // // CrossedOut, characters legible, but // marked for deletion (9). CrossedOut() Value // StrikeThrough is alias for the CrossedOut. StrikeThrough() Value // // Framed (51). Framed() Value // Encircled (52). Encircled() Value // // Overlined (53). Overlined() Value // // Foreground colors // // // Black foreground color (30) Black() Value // Red foreground color (31) Red() Value // Green foreground color (32) Green() Value // Yellow foreground color (33) Yellow() Value // Brown foreground color (33) // // Deprecated: use Yellow instead, following specification Brown() Value // Blue foreground color (34) Blue() Value // Magenta foreground color (35) Magenta() Value // Cyan foreground color (36) Cyan() Value // White foreground color (37) White() Value // // Bright foreground colors // // BrightBlack foreground color (90) BrightBlack() Value // BrightRed foreground color (91) BrightRed() Value // BrightGreen foreground color (92) BrightGreen() Value // BrightYellow foreground color (93) BrightYellow() Value // BrightBlue foreground color (94) BrightBlue() Value // BrightMagenta foreground color (95) BrightMagenta() Value // BrightCyan foreground color (96) BrightCyan() Value // BrightWhite foreground color (97) BrightWhite() Value // // Other // // Index of pre-defined 8-bit foreground color // from 0 to 255 (38;5;n). // // 0- 7: standard colors (as in ESC [ 30–37 m) // 8- 15: high intensity colors (as in ESC [ 90–97 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // Index(n uint8) Value // Gray from 0 to 24. Gray(n uint8) Value // // Background colors // // // BgBlack background color (40) BgBlack() Value // BgRed background color (41) BgRed() Value // BgGreen background color (42) BgGreen() Value // BgYellow background color (43) BgYellow() Value // BgBrown background color (43) // // Deprecated: use BgYellow instead, following specification BgBrown() Value // BgBlue background color (44) BgBlue() Value // BgMagenta background color (45) BgMagenta() Value // BgCyan background color (46) BgCyan() Value // BgWhite background color (47) BgWhite() Value // // Bright background colors // // BgBrightBlack background color (100) BgBrightBlack() Value // BgBrightRed background color (101) BgBrightRed() Value // BgBrightGreen background color (102) BgBrightGreen() Value // BgBrightYellow background color (103) BgBrightYellow() Value // BgBrightBlue background color (104) BgBrightBlue() Value // BgBrightMagenta background color (105) BgBrightMagenta() Value // BgBrightCyan background color (106) BgBrightCyan() Value // BgBrightWhite background color (107) BgBrightWhite() Value // // Other // // BgIndex of 8-bit pre-defined background color // from 0 to 255 (48;5;n). // // 0- 7: standard colors (as in ESC [ 40–47 m) // 8- 15: high intensity colors (as in ESC [100–107 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // BgIndex(n uint8) Value // BgGray from 0 to 24. BgGray(n uint8) Value // // Special // // Colorize removes existing colors and // formats of the argument and applies given. Colorize(color Color) Value } // Value without colors type valueClear struct { value interface{} } func (vc valueClear) String() string { return fmt.Sprint(vc.value) } func (vc valueClear) Color() Color { return 0 } func (vc valueClear) Value() interface{} { return vc.value } func (vc valueClear) tail() Color { return 0 } func (vc valueClear) setTail(Color) Value { return vc } func (vc valueClear) Bleach() Value { return vc } func (vc valueClear) Reset() Value { return vc } func (vc valueClear) Bold() Value { return vc } func (vc valueClear) Faint() Value { return vc } func (vc valueClear) DoublyUnderline() Value { return vc } func (vc valueClear) Fraktur() Value { return vc } func (vc valueClear) Italic() Value { return vc } func (vc valueClear) Underline() Value { return vc } func (vc valueClear) SlowBlink() Value { return vc } func (vc valueClear) RapidBlink() Value { return vc } func (vc valueClear) Blink() Value { return vc } func (vc valueClear) Reverse() Value { return vc } func (vc valueClear) Inverse() Value { return vc } func (vc valueClear) Conceal() Value { return vc } func (vc valueClear) Hidden() Value { return vc } func (vc valueClear) CrossedOut() Value { return vc } func (vc valueClear) StrikeThrough() Value { return vc } func (vc valueClear) Framed() Value { return vc } func (vc valueClear) Encircled() Value { return vc } func (vc valueClear) Overlined() Value { return vc } func (vc valueClear) Black() Value { return vc } func (vc valueClear) Red() Value { return vc } func (vc valueClear) Green() Value { return vc } func (vc valueClear) Yellow() Value { return vc } func (vc valueClear) Brown() Value { return vc } func (vc valueClear) Blue() Value { return vc } func (vc valueClear) Magenta() Value { return vc } func (vc valueClear) Cyan() Value { return vc } func (vc valueClear) White() Value { return vc } func (vc valueClear) BrightBlack() Value { return vc } func (vc valueClear) BrightRed() Value { return vc } func (vc valueClear) BrightGreen() Value { return vc } func (vc valueClear) BrightYellow() Value { return vc } func (vc valueClear) BrightBlue() Value { return vc } func (vc valueClear) BrightMagenta() Value { return vc } func (vc valueClear) BrightCyan() Value { return vc } func (vc valueClear) BrightWhite() Value { return vc } func (vc valueClear) Index(uint8) Value { return vc } func (vc valueClear) Gray(uint8) Value { return vc } func (vc valueClear) BgBlack() Value { return vc } func (vc valueClear) BgRed() Value { return vc } func (vc valueClear) BgGreen() Value { return vc } func (vc valueClear) BgYellow() Value { return vc } func (vc valueClear) BgBrown() Value { return vc } func (vc valueClear) BgBlue() Value { return vc } func (vc valueClear) BgMagenta() Value { return vc } func (vc valueClear) BgCyan() Value { return vc } func (vc valueClear) BgWhite() Value { return vc } func (vc valueClear) BgBrightBlack() Value { return vc } func (vc valueClear) BgBrightRed() Value { return vc } func (vc valueClear) BgBrightGreen() Value { return vc } func (vc valueClear) BgBrightYellow() Value { return vc } func (vc valueClear) BgBrightBlue() Value { return vc } func (vc valueClear) BgBrightMagenta() Value { return vc } func (vc valueClear) BgBrightCyan() Value { return vc } func (vc valueClear) BgBrightWhite() Value { return vc } func (vc valueClear) BgIndex(uint8) Value { return vc } func (vc valueClear) BgGray(uint8) Value { return vc } func (vc valueClear) Colorize(Color) Value { return vc } func (vc valueClear) Format(s fmt.State, verb rune) { // it's enough for many cases (%-+020.10f) // % - 1 // availFlags - 3 (5) // width - 2 // prec - 3 (.23) // verb - 1 // -------------- // 10 format := make([]byte, 1, 10) format[0] = '%' var f byte for i := 0; i < len(availFlags); i++ { if f = availFlags[i]; s.Flag(int(f)) { format = append(format, f) } } var width, prec int var ok bool if width, ok = s.Width(); ok { format = strconv.AppendInt(format, int64(width), 10) } if prec, ok = s.Precision(); ok { format = append(format, '.') format = strconv.AppendInt(format, int64(prec), 10) } if verb > utf8.RuneSelf { format = append(format, string(verb)...) } else { format = append(format, byte(verb)) } fmt.Fprintf(s, string(format), vc.value) } // Value within colors type value struct { value interface{} // value as it color Color // this color tailColor Color // tail color } func (v value) String() string { if v.color != 0 { if v.tailColor != 0 { return esc + v.color.Nos(true) + "m" + fmt.Sprint(v.value) + esc + v.tailColor.Nos(true) + "m" } return esc + v.color.Nos(false) + "m" + fmt.Sprint(v.value) + clear } return fmt.Sprint(v.value) } func (v value) Color() Color { return v.color } func (v value) Bleach() Value { v.color, v.tailColor = 0, 0 return v } func (v value) Reset() Value { v.color, v.tailColor = 0, 0 return v } func (v value) tail() Color { return v.tailColor } func (v value) setTail(t Color) Value { v.tailColor = t return v } func (v value) Value() interface{} { return v.value } func (v value) Format(s fmt.State, verb rune) { // it's enough for many cases (%-+020.10f) // % - 1 // availFlags - 3 (5) // width - 2 // prec - 3 (.23) // verb - 1 // -------------- // 10 // + // \033[ 5 // 0;1;3;4;5;7;8;9;20;21;51;52;53 30 // 38;5;216 8 // 48;5;216 8 // m 1 // + // \033[0m 7 // // x2 (possible tail color) // // 10 + 59 * 2 = 128 format := make([]byte, 0, 128) if v.color != 0 { format = append(format, esc...) format = v.color.appendNos(format, v.tailColor != 0) format = append(format, 'm') } format = append(format, '%') var f byte for i := 0; i < len(availFlags); i++ { if f = availFlags[i]; s.Flag(int(f)) { format = append(format, f) } } var width, prec int var ok bool if width, ok = s.Width(); ok { format = strconv.AppendInt(format, int64(width), 10) } if prec, ok = s.Precision(); ok { format = append(format, '.') format = strconv.AppendInt(format, int64(prec), 10) } if verb > utf8.RuneSelf { format = append(format, string(verb)...) } else { format = append(format, byte(verb)) } if v.color != 0 { if v.tailColor != 0 { // set next (previous) format clearing current one format = append(format, esc...) format = v.tailColor.appendNos(format, true) format = append(format, 'm') } else { format = append(format, clear...) // just clear } } fmt.Fprintf(s, string(format), v.value) } func (v value) Bold() Value { v.color = (v.color &^ FaintFm) | BoldFm return v } func (v value) Faint() Value { v.color = (v.color &^ BoldFm) | FaintFm return v } func (v value) DoublyUnderline() Value { v.color |= DoublyUnderlineFm return v } func (v value) Fraktur() Value { v.color |= FrakturFm return v } func (v value) Italic() Value { v.color |= ItalicFm return v } func (v value) Underline() Value { v.color |= UnderlineFm return v } func (v value) SlowBlink() Value { v.color = (v.color &^ RapidBlinkFm) | SlowBlinkFm return v } func (v value) RapidBlink() Value { v.color = (v.color &^ SlowBlinkFm) | RapidBlinkFm return v } func (v value) Blink() Value { return v.SlowBlink() } func (v value) Reverse() Value { v.color |= ReverseFm return v } func (v value) Inverse() Value { return v.Reverse() } func (v value) Conceal() Value { v.color |= ConcealFm return v } func (v value) Hidden() Value { return v.Conceal() } func (v value) CrossedOut() Value { v.color |= CrossedOutFm return v } func (v value) StrikeThrough() Value { return v.CrossedOut() } func (v value) Framed() Value { v.color |= FramedFm return v } func (v value) Encircled() Value { v.color |= EncircledFm return v } func (v value) Overlined() Value { v.color |= OverlinedFm return v } func (v value) Black() Value { v.color = (v.color &^ maskFg) | BlackFg return v } func (v value) Red() Value { v.color = (v.color &^ maskFg) | RedFg return v } func (v value) Green() Value { v.color = (v.color &^ maskFg) | GreenFg return v } func (v value) Yellow() Value { v.color = (v.color &^ maskFg) | YellowFg return v } func (v value) Brown() Value { return v.Yellow() } func (v value) Blue() Value { v.color = (v.color &^ maskFg) | BlueFg return v } func (v value) Magenta() Value { v.color = (v.color &^ maskFg) | MagentaFg return v } func (v value) Cyan() Value { v.color = (v.color &^ maskFg) | CyanFg return v } func (v value) White() Value { v.color = (v.color &^ maskFg) | WhiteFg return v } func (v value) BrightBlack() Value { v.color = (v.color &^ maskFg) | BrightFg | BlackFg return v } func (v value) BrightRed() Value { v.color = (v.color &^ maskFg) | BrightFg | RedFg return v } func (v value) BrightGreen() Value { v.color = (v.color &^ maskFg) | BrightFg | GreenFg return v } func (v value) BrightYellow() Value { v.color = (v.color &^ maskFg) | BrightFg | YellowFg return v } func (v value) BrightBlue() Value { v.color = (v.color &^ maskFg) | BrightFg | BlueFg return v } func (v value) BrightMagenta() Value { v.color = (v.color &^ maskFg) | BrightFg | MagentaFg return v } func (v value) BrightCyan() Value { v.color = (v.color &^ maskFg) | BrightFg | CyanFg return v } func (v value) BrightWhite() Value { v.color = (v.color &^ maskFg) | BrightFg | WhiteFg return v } func (v value) Index(n uint8) Value { v.color = (v.color &^ maskFg) | (Color(n) << shiftFg) | flagFg return v } func (v value) Gray(n uint8) Value { if n > 23 { n = 23 } v.color = (v.color &^ maskFg) | (Color(232+n) << shiftFg) | flagFg return v } func (v value) BgBlack() Value { v.color = (v.color &^ maskBg) | BlackBg return v } func (v value) BgRed() Value { v.color = (v.color &^ maskBg) | RedBg return v } func (v value) BgGreen() Value { v.color = (v.color &^ maskBg) | GreenBg return v } func (v value) BgYellow() Value { v.color = (v.color &^ maskBg) | YellowBg return v } func (v value) BgBrown() Value { return v.BgYellow() } func (v value) BgBlue() Value { v.color = (v.color &^ maskBg) | BlueBg return v } func (v value) BgMagenta() Value { v.color = (v.color &^ maskBg) | MagentaBg return v } func (v value) BgCyan() Value { v.color = (v.color &^ maskBg) | CyanBg return v } func (v value) BgWhite() Value { v.color = (v.color &^ maskBg) | WhiteBg return v } func (v value) BgBrightBlack() Value { v.color = (v.color &^ maskBg) | BrightBg | BlackBg return v } func (v value) BgBrightRed() Value { v.color = (v.color &^ maskBg) | BrightBg | RedBg return v } func (v value) BgBrightGreen() Value { v.color = (v.color &^ maskBg) | BrightBg | GreenBg return v } func (v value) BgBrightYellow() Value { v.color = (v.color &^ maskBg) | BrightBg | YellowBg return v } func (v value) BgBrightBlue() Value { v.color = (v.color &^ maskBg) | BrightBg | BlueBg return v } func (v value) BgBrightMagenta() Value { v.color = (v.color &^ maskBg) | BrightBg | MagentaBg return v } func (v value) BgBrightCyan() Value { v.color = (v.color &^ maskBg) | BrightBg | CyanBg return v } func (v value) BgBrightWhite() Value { v.color = (v.color &^ maskBg) | BrightBg | WhiteBg return v } func (v value) BgIndex(n uint8) Value { v.color = (v.color &^ maskBg) | (Color(n) << shiftBg) | flagBg return v } func (v value) BgGray(n uint8) Value { if n > 23 { n = 23 } v.color = (v.color &^ maskBg) | (Color(232+n) << shiftBg) | flagBg return v } func (v value) Colorize(color Color) Value { v.color = color return v } aurora-3.0.0/value_test.go000066400000000000000000000323061370455577600155340ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "fmt" "testing" ) func TestValue_String(t *testing.T) { var v Value // colorized v = value{"x", 0, 0} if x := v.String(); x != "x" { t.Errorf("(value).String: want %q, got %q", "x", x) } v = value{"x", BlackFg, RedBg} want := "\033[0;30mx\033[0;41m" if got := v.String(); want != got { t.Errorf("(value).String: want %q, got %q", want, got) } // clear v = valueClear{"x"} if x := v.String(); x != "x" { t.Errorf("(value).String: want %q, got %q", "x", x) } } func TestValue_Color(t *testing.T) { // colorized if (value{"", RedFg, 0}).Color() != RedFg { t.Error("wrong color") } // clear if (valueClear{0}).Color() != 0 { t.Error("wrong color") } } func TestValue_Value(t *testing.T) { // colorized if (value{"x", RedFg, BlueBg}).Value() != "x" { t.Error("wrong value") } // clear if (valueClear{"x"}).Value() != "x" { t.Error("wrong value") } } func TestValue_Bleach(t *testing.T) { // colorized if (value{"x", RedFg, BlueBg}).Bleach() != (value{value: "x"}) { t.Error("wrong bleached") } // clear if (valueClear{"x"}).Bleach() != (valueClear{"x"}) { t.Error("wrong bleached") } } func TestValue_Format(t *testing.T) { var v Value var want, got string // // colorized // v = value{3.14, RedFg, BlueBg} got = fmt.Sprintf("%+1.3g", v) want = "\033[0;31m" + fmt.Sprintf("%+1.3g", 3.14) + "\033[0;44m" if want != got { t.Errorf("Format: want %q, got %q", want, got) } // var utf8Verb = "%+1.3世" // verb that fit more then 1 byte got = fmt.Sprintf(utf8Verb, v) want = "\033[0;31m" + fmt.Sprintf(utf8Verb, 3.14) + "\033[0;44m" if want != got { t.Errorf("Format: want %q, got %q", want, got) } // // clear // v = valueClear{3.14} got = fmt.Sprintf("%+1.3g", v) want = fmt.Sprintf("%+1.3g", 3.14) if want != got { t.Errorf("Format: want %q, got %q", want, got) } // got = fmt.Sprintf(utf8Verb, v) want = fmt.Sprintf(utf8Verb, 3.14) if want != got { t.Errorf("Format: want %q, got %q", want, got) } } func Test_tail(t *testing.T) { // colorized if (value{"x", 0, BlueBg}).tail() != BlueBg { t.Error("wrong tail color") } // clear if (valueClear{"x"}).tail() != 0 { t.Error("wrong tail color") } } func Test_setTail(t *testing.T) { // colorized if (value{"x", 0, 0}).setTail(RedFg) != (value{"x", 0, RedFg}) { t.Error("wrong setTail behavior") } // clear if (valueClear{"x"}).setTail(RedFg) != (valueClear{"x"}) { t.Error("wrong setTail behavior") } } func TestValue_colors(t *testing.T) { test := func(name string, v Value, clr Color) { t.Helper() if c := v.Color(); c != clr { t.Errorf("wrong color for %s: want %d, got %d", name, clr, c) } } // colorized test("Reset", Reset("x"), 0) test("Bold", Bold("x"), BoldFm) test("Faint", Faint("x"), FaintFm) test("DoublyUnderline", DoublyUnderline("x"), DoublyUnderlineFm) test("Fraktur & Yellow", Yellow(Fraktur("x")), FrakturFm|YellowFg) test("Italic", Italic("x"), ItalicFm) test("Underline", Underline("x"), UnderlineFm) test("SlowBlink", SlowBlink("x"), SlowBlinkFm) test("RapidBlink", RapidBlink("x"), RapidBlinkFm) test("Blink", Blink("x"), BlinkFm) test("Reverse", Reverse("x"), ReverseFm) test("Inverse", Inverse("x"), InverseFm) test("Conceal", Conceal("x"), ConcealFm) test("Hidden", Hidden("x"), HiddenFm) test("CrossedOut", CrossedOut("x"), CrossedOutFm) test("StrikeThrough", StrikeThrough("x"), StrikeThroughFm) test("Framed", Framed("x"), FramedFm) test("Encircled", Encircled("x"), EncircledFm) test("Overlined", Overlined("x"), OverlinedFm) test("Black", Black("x"), BlackFg) test("Red", Red("x"), RedFg) test("Green", Green("x"), GreenFg) test("Yellow", Yellow("x"), YellowFg) test("Brown", Brown("x"), BrownFg) test("Blue", Blue("x"), BlueFg) test("Magenta", Magenta("x"), MagentaFg) test("Cyan", Cyan("x"), CyanFg) test("White", White("x"), WhiteFg) test("BrightBlack", BrightBlack("x"), BrightFg|BlackFg) test("BrightRed", BrightRed("x"), BrightFg|RedFg) test("BrightGreen", BrightGreen("x"), BrightFg|GreenFg) test("BrightYellow", BrightYellow("x"), BrightFg|YellowFg) test("BrightBlue", BrightBlue("x"), BrightFg|BlueFg) test("BrightMagenta", BrightMagenta("x"), BrightFg|MagentaFg) test("BrightCyan", BrightCyan("x"), BrightFg|CyanFg) test("BrightWhite", BrightWhite("x"), BrightFg|WhiteFg) test("Index", Index(178, "x"), (Color(178)< // package aurora // Colorize wraps given value into Value with // given colors. For example // // s := Colorize("some", BlueFg|GreenBg|BoldFm) // // returns a Value with blue foreground, green // background and bold. Unlike functions like // Red/BgBlue/Bold etc. This function clears // all previous colors and formats. Thus // // s := Colorize(Red("some"), BgBlue) // // clears red color from value func Colorize(arg interface{}, color Color) Value { if val, ok := arg.(value); ok { val.color = color return val } return value{arg, color, 0} } // Reset wraps given argument returning Value // without formats and colors. func Reset(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Reset() } return value{value: arg} } // // Formats // // Bold or increased intensity (1). func Bold(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Bold() } return value{value: arg, color: BoldFm} } // Faint decreases intensity (2). // The Faint rejects the Bold. func Faint(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Faint() } return value{value: arg, color: FaintFm} } // DoublyUnderline or Bold off, double-underline // per ECMA-48 (21). func DoublyUnderline(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.DoublyUnderline() } return value{value: arg, color: DoublyUnderlineFm} } // Fraktur is rarely supported (20). func Fraktur(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Fraktur() } return value{value: arg, color: FrakturFm} } // Italic is not widely supported, sometimes // treated as inverse (3). func Italic(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Italic() } return value{value: arg, color: ItalicFm} } // Underline (4). func Underline(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Underline() } return value{value: arg, color: UnderlineFm} } // SlowBlink makes text blink less than // 150 per minute (5). func SlowBlink(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.SlowBlink() } return value{value: arg, color: SlowBlinkFm} } // RapidBlink makes text blink 150+ per // minute. It is not widely supported (6). func RapidBlink(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.RapidBlink() } return value{value: arg, color: RapidBlinkFm} } // Blink is alias for the SlowBlink. func Blink(arg interface{}) Value { return SlowBlink(arg) } // Reverse video, swap foreground and // background colors (7). func Reverse(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Reverse() } return value{value: arg, color: ReverseFm} } // Inverse is alias for the Reverse func Inverse(arg interface{}) Value { return Reverse(arg) } // Conceal hides text, preserving an ability to select // the text and copy it. It is not widely supported (8). func Conceal(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Conceal() } return value{value: arg, color: ConcealFm} } // Hidden is alias for the Conceal func Hidden(arg interface{}) Value { return Conceal(arg) } // CrossedOut makes characters legible, but // marked for deletion (9). func CrossedOut(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.CrossedOut() } return value{value: arg, color: CrossedOutFm} } // StrikeThrough is alias for the CrossedOut. func StrikeThrough(arg interface{}) Value { return CrossedOut(arg) } // Framed (51). func Framed(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Framed() } return value{value: arg, color: FramedFm} } // Encircled (52). func Encircled(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Encircled() } return value{value: arg, color: EncircledFm} } // Overlined (53). func Overlined(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Overlined() } return value{value: arg, color: OverlinedFm} } // // Foreground colors // // // Black foreground color (30) func Black(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Black() } return value{value: arg, color: BlackFg} } // Red foreground color (31) func Red(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Red() } return value{value: arg, color: RedFg} } // Green foreground color (32) func Green(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Green() } return value{value: arg, color: GreenFg} } // Yellow foreground color (33) func Yellow(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Yellow() } return value{value: arg, color: YellowFg} } // Brown foreground color (33) // // Deprecated: use Yellow instead, following specification func Brown(arg interface{}) Value { return Yellow(arg) } // Blue foreground color (34) func Blue(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Blue() } return value{value: arg, color: BlueFg} } // Magenta foreground color (35) func Magenta(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Magenta() } return value{value: arg, color: MagentaFg} } // Cyan foreground color (36) func Cyan(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Cyan() } return value{value: arg, color: CyanFg} } // White foreground color (37) func White(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.White() } return value{value: arg, color: WhiteFg} } // // Bright foreground colors // // BrightBlack foreground color (90) func BrightBlack(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightBlack() } return value{value: arg, color: BrightFg | BlackFg} } // BrightRed foreground color (91) func BrightRed(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightRed() } return value{value: arg, color: BrightFg | RedFg} } // BrightGreen foreground color (92) func BrightGreen(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightGreen() } return value{value: arg, color: BrightFg | GreenFg} } // BrightYellow foreground color (93) func BrightYellow(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightYellow() } return value{value: arg, color: BrightFg | YellowFg} } // BrightBlue foreground color (94) func BrightBlue(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightBlue() } return value{value: arg, color: BrightFg | BlueFg} } // BrightMagenta foreground color (95) func BrightMagenta(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightMagenta() } return value{value: arg, color: BrightFg | MagentaFg} } // BrightCyan foreground color (96) func BrightCyan(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightCyan() } return value{value: arg, color: BrightFg | CyanFg} } // BrightWhite foreground color (97) func BrightWhite(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BrightWhite() } return value{value: arg, color: BrightFg | WhiteFg} } // // Other // // Index of pre-defined 8-bit foreground color // from 0 to 255 (38;5;n). // // 0- 7: standard colors (as in ESC [ 30–37 m) // 8- 15: high intensity colors (as in ESC [ 90–97 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // func Index(n uint8, arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Index(n) } return value{value: arg, color: (Color(n) << shiftFg) | flagFg} } // Gray from 0 to 24. func Gray(n uint8, arg interface{}) Value { if val, ok := arg.(Value); ok { return val.Gray(n) } if n > 23 { n = 23 } return value{value: arg, color: (Color(232+n) << shiftFg) | flagFg} } // // Background colors // // // BgBlack background color (40) func BgBlack(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBlack() } return value{value: arg, color: BlackBg} } // BgRed background color (41) func BgRed(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgRed() } return value{value: arg, color: RedBg} } // BgGreen background color (42) func BgGreen(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgGreen() } return value{value: arg, color: GreenBg} } // BgYellow background color (43) func BgYellow(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgYellow() } return value{value: arg, color: YellowBg} } // BgBrown background color (43) // // Deprecated: use BgYellow instead, following specification func BgBrown(arg interface{}) Value { return BgYellow(arg) } // BgBlue background color (44) func BgBlue(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBlue() } return value{value: arg, color: BlueBg} } // BgMagenta background color (45) func BgMagenta(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgMagenta() } return value{value: arg, color: MagentaBg} } // BgCyan background color (46) func BgCyan(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgCyan() } return value{value: arg, color: CyanBg} } // BgWhite background color (47) func BgWhite(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgWhite() } return value{value: arg, color: WhiteBg} } // // Bright background colors // // BgBrightBlack background color (100) func BgBrightBlack(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightBlack() } return value{value: arg, color: BrightBg | BlackBg} } // BgBrightRed background color (101) func BgBrightRed(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightRed() } return value{value: arg, color: BrightBg | RedBg} } // BgBrightGreen background color (102) func BgBrightGreen(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightGreen() } return value{value: arg, color: BrightBg | GreenBg} } // BgBrightYellow background color (103) func BgBrightYellow(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightYellow() } return value{value: arg, color: BrightBg | YellowBg} } // BgBrightBlue background color (104) func BgBrightBlue(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightBlue() } return value{value: arg, color: BrightBg | BlueBg} } // BgBrightMagenta background color (105) func BgBrightMagenta(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightMagenta() } return value{value: arg, color: BrightBg | MagentaBg} } // BgBrightCyan background color (106) func BgBrightCyan(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightCyan() } return value{value: arg, color: BrightBg | CyanBg} } // BgBrightWhite background color (107) func BgBrightWhite(arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgBrightWhite() } return value{value: arg, color: BrightBg | WhiteBg} } // // Other // // BgIndex of 8-bit pre-defined background color // from 0 to 255 (48;5;n). // // 0- 7: standard colors (as in ESC [ 40–47 m) // 8- 15: high intensity colors (as in ESC [100–107 m) // 16-231: 6 × 6 × 6 cube (216 colors): 16 + 36 × r + 6 × g + b (0 ≤ r, g, b ≤ 5) // 232-255: grayscale from black to white in 24 steps // func BgIndex(n uint8, arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgIndex(n) } return value{value: arg, color: (Color(n) << shiftBg) | flagBg} } // BgGray from 0 to 24. func BgGray(n uint8, arg interface{}) Value { if val, ok := arg.(Value); ok { return val.BgGray(n) } if n > 23 { n = 23 } return value{value: arg, color: (Color(n+232) << shiftBg) | flagBg} } aurora-3.0.0/wrap_test.go000066400000000000000000000316341370455577600153740ustar00rootroot00000000000000// // Copyright (c) 2016-2020 The Aurora Authors. All rights reserved. // This program is free software. It comes without any warranty, // to the extent permitted by applicable law. You can redistribute // it and/or modify it under the terms of the Unlicense. See LICENSE // file for more details or see below. // // // This is free and unencumbered software released into the public domain. // // Anyone is free to copy, modify, publish, use, compile, sell, or // distribute this software, either in source code form or as a compiled // binary, for any purpose, commercial or non-commercial, and by any // means. // // In jurisdictions that recognize copyright laws, the author or authors // of this software dedicate any and all copyright interest in the // software to the public domain. We make this dedication for the benefit // of the public at large and to the detriment of our heirs and // successors. We intend this dedication to be an overt act of // relinquishment in perpetuity of all present and future rights to this // software under copyright law. // // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, // EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. // IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR // OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, // ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR // OTHER DEALINGS IN THE SOFTWARE. // // For more information, please refer to // package aurora import ( "testing" ) func testFunc(t *testing.T, name string, v Value, clr Color) { t.Helper() if str, ok := v.Value().(string); !ok { t.Errorf("%s wrong value type: %t, expected string", name, v.Value()) } else if str != "x" { t.Errorf("%s wrong value: '%v', expected 'x'", name, v.Value()) } if !isTail(v, 0) { t.Errorf("%s wrong tail: %d", name, v.tail()) } if !isColor(v, clr) { t.Errorf("%s wrong color: %d, want: %d", name, v.Color(), clr) } } func Test_Reset(t *testing.T) { testFunc(t, "Reset", Reset("x"), 0) testFunc(t, "Complex Reset", Reset(DoublyUnderline(Underline("x"))), 0) } func Test_Bold(t *testing.T) { testFunc(t, "Bold", Bold("x"), BoldFm) testFunc(t, "Complex Bold", Bold(Italic(Red("x"))), ItalicFm|RedFg|BoldFm) } func Test_Faint(t *testing.T) { testFunc(t, "Faint", Faint("x"), FaintFm) testFunc(t, "Complex Faint", Faint(BrightBlack("x").BgBrightGreen()), BrightFg|BlackFg|FaintFm|BrightBg|GreenBg) } func Test_DoublyUnderline(t *testing.T) { testFunc(t, "DoublyUnderline", DoublyUnderline("x"), DoublyUnderlineFm) testFunc(t, "Complex DoublyUnderline", DoublyUnderline(BrightBlue("x")), BrightFg|BlueFg|DoublyUnderlineFm) } func Test_Fraktur(t *testing.T) { testFunc(t, "Fraktur", Fraktur("x"), FrakturFm) testFunc(t, "Complex Fraktur", Fraktur(Faint("x").BgBrightCyan()), FaintFm|FrakturFm|BrightBg|CyanBg) } func Test_Italic(t *testing.T) { testFunc(t, "Italic", Italic("x"), ItalicFm) testFunc(t, "Complex Italic", Italic(BgBrightBlack("x")), ItalicFm|BrightBg|BlackBg) } func Test_Underline(t *testing.T) { testFunc(t, "Underline", Underline("x"), UnderlineFm) testFunc(t, "Complex Underline", Underline(Faint("x").Bold()), UnderlineFm|BoldFm) } func Test_SlowBlink(t *testing.T) { testFunc(t, "SlowBlink", SlowBlink("x"), SlowBlinkFm) testFunc(t, "Complex SlowBlink", SlowBlink(Reverse("x").Bold().Faint()), SlowBlinkFm|ReverseFm|FaintFm) } func Test_RapidBlink(t *testing.T) { testFunc(t, "RapidBlink", RapidBlink("x"), RapidBlinkFm) testFunc(t, "Complex RapidBlink", RapidBlink(Italic(Bold("x"))), RapidBlinkFm|ItalicFm|BoldFm) } func Test_Blink(t *testing.T) { testFunc(t, "Blink", Blink("x"), BlinkFm) testFunc(t, "Complex Blink", Blink(Reverse("x").Italic()), BlinkFm|ReverseFm|ItalicFm) } func Test_Reverse(t *testing.T) { testFunc(t, "Reverse", Reverse("x"), ReverseFm) testFunc(t, "Complex Reverse", Reverse(Italic("x").Reverse()), ReverseFm|ItalicFm|ReverseFm) } func Test_Inverse(t *testing.T) { testFunc(t, "Inverse", Inverse("x"), InverseFm) testFunc(t, "Complex Inverse", Inverse(Italic("x").Overlined()), InverseFm|ItalicFm|OverlinedFm) } func Test_Conceal(t *testing.T) { testFunc(t, "Conceal", Conceal("x"), ConcealFm) testFunc(t, "Complex Conceal", Conceal(Underline("x").Italic()), ConcealFm|UnderlineFm|ItalicFm) } func Test_Hidden(t *testing.T) { testFunc(t, "Hidden", Hidden("x"), HiddenFm) testFunc(t, "Complex Hidden", Hidden(Overlined("x")), HiddenFm|OverlinedFm) } func Test_CrossedOut(t *testing.T) { testFunc(t, "CrossedOut", CrossedOut("x"), CrossedOutFm) testFunc(t, "Complex CrossedOut", CrossedOut(BgRed("x")), CrossedOutFm|RedBg) } func Test_StrikeThrough(t *testing.T) { testFunc(t, "StrikeThrough", StrikeThrough("x"), StrikeThroughFm) testFunc(t, "Complex StrikeThrough", StrikeThrough(BgBrightCyan("x")), StrikeThroughFm|BrightBg|CyanBg) } func Test_Framed(t *testing.T) { testFunc(t, "Framed", Framed("x"), FramedFm) testFunc(t, "Complex Framed", Framed(Overlined("x").Underline()), FramedFm|OverlinedFm|UnderlineFm) } func Test_Encircled(t *testing.T) { testFunc(t, "Encircled", Encircled("x"), EncircledFm) testFunc(t, "Complex Encircled", Encircled(Italic("x").Overlined()), EncircledFm|ItalicFm|OverlinedFm) } func Test_Overlined(t *testing.T) { testFunc(t, "Overlined", Overlined("x"), OverlinedFm) testFunc(t, "Complex Overlined", Overlined(BgBrightWhite("x").Reverse()), OverlinedFm|BrightBg|WhiteBg|ReverseFm) } func Test_Black(t *testing.T) { testFunc(t, "Black", Black("x"), BlackFg) testFunc(t, "Complex Black", Black(Overlined("x").BgRed()), BlackFg|OverlinedFm|RedBg) } func Test_Red(t *testing.T) { testFunc(t, "Red", Red("x"), RedFg) testFunc(t, "Complex Red", Red(Inverse("x").DoublyUnderline()), RedFg|InverseFm|DoublyUnderlineFm) } func Test_Green(t *testing.T) { testFunc(t, "Green", Green("x"), GreenFg) testFunc(t, "Complex Green", Green(BgMagenta("x").Inverse().Reverse()), GreenFg|MagentaBg|InverseFm|ReverseFm) } func Test_Yellow(t *testing.T) { testFunc(t, "Yellow", Yellow("x"), YellowFg) testFunc(t, "Complex Yellow", Yellow(Bold("x").BgBrightMagenta()), YellowFg|BoldFm|BrightBg|MagentaBg) } func Test_Brown(t *testing.T) { testFunc(t, "Brown", Brown("x"), BrownFg) testFunc(t, "Complex Brown", Brown(BgBrightBlue("x").Bold()), BrownFg|BrightBg|BlueBg|BoldFm) } func Test_Blue(t *testing.T) { testFunc(t, "Blue", Blue("x"), BlueFg) testFunc(t, "Complex Blue", Blue(Fraktur("x").Underline()), BlueFg|FrakturFm|UnderlineFm) } func Test_Magenta(t *testing.T) { testFunc(t, "Magenta", Magenta("x"), MagentaFg) testFunc(t, "Complex Magenta", Magenta(DoublyUnderline("x").Fraktur()), MagentaFg|DoublyUnderlineFm|FrakturFm) } func Test_Cyan(t *testing.T) { testFunc(t, "Cyan", Cyan("x"), CyanFg) testFunc(t, "Complex Cyan", Cyan(StrikeThrough("x")), CyanFg|StrikeThroughFm) } func Test_White(t *testing.T) { testFunc(t, "White", White("x"), WhiteFg) testFunc(t, "Complex White", White(Inverse("x").Blink()), WhiteFg|InverseFm|BlinkFm) } func Test_BrightBlack(t *testing.T) { testFunc(t, "BrightBlack", BrightBlack("x"), BrightFg|BlackFg) testFunc(t, "Complex BrightBlack", BrightBlack(BgBrightGreen("x")), BrightFg|BlackFg|BrightBg|GreenBg) } func Test_BrightRed(t *testing.T) { testFunc(t, "BrightRed", BrightRed("x"), BrightFg|RedFg) testFunc(t, "Complex BrightRed", BrightRed(Bold("x").BgYellow()), BrightFg|RedFg|BoldFm|YellowBg) } func Test_BrightGreen(t *testing.T) { testFunc(t, "BrightGreen", BrightGreen("x"), BrightFg|GreenFg) testFunc(t, "Complex BrightGreen", BrightGreen(Faint("x")), BrightFg|GreenFg|FaintFm) } func Test_BrightYellow(t *testing.T) { testFunc(t, "BrightYellow", BrightYellow("x"), BrightFg|YellowFg) testFunc(t, "Complex BrightYellow", BrightYellow(BgRed("x")), BrightFg|YellowFg|RedBg) } func Test_BrightBlue(t *testing.T) { testFunc(t, "BrightBlue", BrightBlue("x"), BrightFg|BlueFg) testFunc(t, "Complex BrightBlue", BrightBlue(DoublyUnderline("x")), BrightFg|BlueFg|DoublyUnderlineFm) } func Test_BrightMagenta(t *testing.T) { testFunc(t, "BrightMagenta", BrightMagenta("x"), BrightFg|MagentaFg) testFunc(t, "Complex BrightMagenta", BrightMagenta(Underline("x")), BrightFg|MagentaFg|UnderlineFm) } func Test_BrightCyan(t *testing.T) { testFunc(t, "BrightCyan", BrightCyan("x"), BrightFg|CyanFg) testFunc(t, "Complex BrightCyan", BrightCyan(BgGreen("x").Italic()), BrightFg|CyanFg|GreenBg|ItalicFm) } func Test_BrightWhite(t *testing.T) { testFunc(t, "BrightWhite", BrightWhite("x"), BrightFg|WhiteFg) testFunc(t, "Complex BrightWhite", BrightWhite(Inverse("x").BgRed()), BrightFg|WhiteFg|InverseFm|RedBg) } func Test_Index(t *testing.T) { testFunc(t, "Index", Index(178, "x"), (Color(178)<