1
0
mirror of https://github.com/fatih/color.git synced 2024-11-24 08:02:14 +02:00
Commit Graph

39 Commits

Author SHA1 Message Date
Fatih Arslan
5723903daa Add RGB API support
Signed-off-by: Fatih Arslan <ftharsln@gmail.com>
2024-10-03 10:00:13 +03:00
Klaus Post
00b1811a3d
Fix multi-parameter println spacing
`fmt.Println` will add spaces between elements when there is multiple parameters sent.

When wrapping the colors parameters were combined using `fmt.Sprint(a...)` - which does not space out parameters.

Use `fmt.Sprintln` to combine parameters.

Fixes #218
2024-04-08 13:10:58 +02:00
Fatih Arslan
b5f9b4c560
Apply suggestions from code review 2023-10-18 10:07:36 +03:00
Greg Poirson
db0d19c324 escape sequences instead of unicode ctrl char #206 2023-10-17 21:25:24 -03:00
Greg Poirson
641fc85af5 fixes #206 2023-10-16 21:27:30 -03:00
Greg Poirson
c33f29cd0e fixes #206 2023-10-13 19:30:42 -03:00
Fatih Arslan
a2983f4b63 color: add newline after wrapping text
The newline should be added after wrapping the input with escape
sequences. That way `less` or other commands can parse the output
correctly.

fixes https://github.com/fatih/color/issues/157
2023-03-12 20:10:19 +03:00
Robert Pająk
b06fcbf502
Add Test_noColorIsSet 2022-11-13 11:13:42 +01:00
Robert Pająk
8e3ccd4921
NO_COLOR requires a non-empty string 2022-11-13 10:58:32 +01:00
Fatih Arslan
d22b618612 Fix staticcheck warnings 2021-12-16 11:00:24 +03:00
Fatih Arslan
f08ed43f5e Add NO_COLOR support to disable color output
This PR adds support for the enviroment variable `NO_COLOR`. If set
(regardless of its value), the `colors` package disables color output.
For more information about this environment variable please checkout
this website: https://no-color.org

closes: https://github.com/fatih/color/issues/136
2021-05-13 22:29:58 +03:00
Linda_pp
570b54cabe Add Hi* helpers for hi-intensity colors (#68)
* Add Hi* helpers for hi-intensity colors
2017-05-23 16:53:55 +03:00
Erik Hollensbe
cd9740438a Add direct Sprintf support
Signed-off-by: Erik Hollensbe <github@hollensbe.org>
2017-02-07 09:42:30 -08:00
Fatih Arslan
80fdc4010e Add Fprint style functions
* Add Fprint, Fprintf and Fprintln functions
* Add FprintFunc, FprintfFunc and FprintlnFunc functions
* Improved readability of code base
* Updated the docs
2017-01-03 18:58:49 +03:00
Cameron Moore
0016e26890 Properly handle single arg calls to helper funcs (#40)
* Properly handle single arg calls to helper funcs
2016-09-27 18:48:50 +03:00
Harshavardhana
250120a4f0 Remove last references of unused ansicolor package. 2016-02-12 01:13:08 -08:00
Alex Guerrieri
aa04f74371 Added high intensity colours 2015-10-26 09:54:07 +01:00
Andrew Austin
4fb3d84ad3 color: add Equals() method to compare two colors 2015-08-23 17:34:52 -04:00
Fatih Arslan
2f376994f3 color_test: explicitly set NoColor to false
fixes #21
2015-08-20 21:45:44 +03:00
Fatih Arslan
b82cd6d93d color: export back color.Set(), fixes #13 2015-05-04 21:28:38 +03:00
Fatih Arslan
2769863a2d color_test: add global test too 2015-04-22 11:19:51 +03:00
Fatih Arslan
95e7214071 color: add helper function for bool pointer 2015-04-22 11:13:04 +03:00
Fatih Arslan
85fc70c416 color: add NoColor option, both on global and local scope 2015-04-22 11:06:21 +03:00
Fatih Arslan
969c0f0b28 color: add Windows support via ansicolor 2015-03-12 14:00:06 +02:00
Fatih Arslan
253e0f98bf color: start to play to implement Windows support 2015-03-12 13:27:56 +02:00
Fatih Arslan
36f10a0700 Fix Readme.md, add colorstring helper functions 2014-02-24 10:01:46 -08:00
Fatih Arslan
99c00de6f8 Add documentation about Sprint functions. 2014-02-18 03:26:43 -08:00
Fatih Arslan
05210eb369 Implement SprintXxx functions 2014-02-18 03:18:22 -08:00
Fatih Arslan
c297f2223f Add PrintFunc.. functions and update readme.md 2014-02-18 02:52:23 -08:00
Fatih Arslan
db165dd21a Fix test 2014-02-18 01:06:54 -08:00
Fatih Arslan
ca40f52e4f Add Set() and Unset() 2014-02-18 00:20:24 -08:00
Fatih Arslan
6ba802d6b6 Add helper Color functions 2014-02-17 23:46:20 -08:00
Fatih Arslan
57ae7cd7bc More fixes and API changes. 2014-02-17 23:39:09 -08:00
Fatih Arslan
ae1bfdea97 Add a useful test 2014-02-17 23:25:12 -08:00
Fatih Arslan
af41e08e44 Improve test. 2014-02-17 02:18:54 -08:00
Fatih Arslan
0943b76fa0 Improve tests. 2014-02-17 01:58:08 -08:00
Fatih Arslan
823f4ed20f Updates and cosmetic changes. 2014-02-17 01:47:15 -08:00
Fatih Arslan
8653b308b1 Improve README and add examples to test. 2014-02-17 01:40:02 -08:00
Fatih Arslan
636dfd47b1 Initial commit, WIP 2014-02-17 01:12:32 -08:00