Christian Rocha
01248034d0
chore(lint): add various nolint directives ( #206 )
...
Generally run-of-the-mill directives to disable magic number and exhaustive switches. Reasonings should be self explanatory while reading the code and comments, where applicable.
2023-07-24 11:50:04 -04:00
Glenn Gonda
303724f7da
docs: fix typos and clean up comments ( #182 )
2023-03-12 11:04:42 +01:00
Ayman Bagabas
53fe53727e
feat: conform to the Go color interface
...
implement RGBA with the default output
2023-02-09 11:59:54 -05:00
Ayman Bagabas
b9c2626fe7
feat(renderer): use style renderer
...
lipgloss.Style now takes a renderer instance to be used to detect styles
and colors based on its termenv.Output and terminal
2023-02-09 11:59:54 -05:00
Ayman Bagabas
31ab45f810
feat: instantiate lipgloss renderers
...
* Use lipgloss instances instead of a singleton global instance
* Deprecate (s Style).Render & (s Style).String
* Deprecate the Stringer interface
* Update README and godocs
* Update example
2023-02-09 11:59:54 -05:00
Carlos A Becker
f754c404f6
fix: reduce dependencies
...
Signed-off-by: Carlos A Becker <caarlos0@users.noreply.github.com>
2023-02-09 11:59:54 -05:00
nervo
1c1240fd65
docs: fix various typos ( #156 )
2022-11-08 10:55:11 +01:00
Christian Muehlhaeuser
0b889bb8b6
docs: fix RGBA godocs
2022-09-30 05:04:05 +02:00
Christian Muehlhaeuser
651d1265e7
fix: RGBA implementations for non-hex color values
2022-09-30 04:57:44 +02:00
Christian Rocha
0ee74a5a90
feat: non-interpolated colors, aka CompleteColor ( #100 )
...
* feat: add color types for specifying colors on a per-profile basis
* chore: remove go-colourful references
* fix: lint (#101 )
Co-authored-by: Ayman Bagabas <ayman.bagabas@gmail.com>
2022-08-30 13:38:15 -07:00
Christian Rocha
2cb1d4a5c1
docs(lint): update example code in GoDocs per new style standard
...
This revision was made automatically via 'golangci-lint run --fix'
2022-08-24 09:22:45 -07:00
Christian Rocha
81744becf3
chore(lint): remove magic numbers
2022-08-17 17:13:05 -07:00
Christian Rocha
1fb1fb9602
chore: drop go-colorful dependency (but it's a great lib)
2022-08-17 17:13:05 -07:00
Christian Muehlhaeuser
0c67c8c3bb
Protect against concurrent color profile access with a sync.RWMutex
2022-02-14 16:13:12 -05:00
Christian Muehlhaeuser
0ba6420185
Use termenv's EnvColorProfile, which respects NO_COLOR and CLICOLOR_FORCE env vars
2022-02-06 04:18:22 +01:00
Christian Muehlhaeuser
8a90d5aa4b
Fix typo in AdaptiveColor's godoc comment
2022-02-06 03:05:13 +01:00
Christian Muehlhaeuser
b3934f5a81
Lazily detect background color setting
...
This change prevents Lipgloss from querying the terminal's background
color setting on init. Instead, the background color will get queried
the first time the setting gets accessed by HasDarkBackground, and the
result will be cached.
Furthermore SetHasDarkBackground(bool) has been added, which explicitly
sets a value and avoids the automatic detection from ever being run.
2022-02-04 05:03:02 +01:00
Christian Rocha
117c27dc45
Add SetColorProfile for explicitly setting the color profile
2021-05-31 12:47:39 -04:00
Christian Rocha
f7065243b8
Query terminal background color on initialization
2021-04-16 21:30:49 -04:00
Christian Rocha
874349bbec
Don't enable ANSI in cmd.exe until absolutely necessary
2021-04-06 11:39:01 -04:00
Christian Rocha
fedd7a49aa
Enable ANSI colors in cmd.exe and Windows PowerShell in Windows 10
2021-04-06 11:39:01 -04:00
Christian Rocha
b3875326a3
Don't check color profile and terminal darkness until absolutely necessary
2021-04-05 10:43:01 -04:00
Christian Rocha
408a26e349
Whoops, fix infinite recursion and actualy implement Go Color
2021-04-02 10:22:05 -04:00
Christian Rocha
5eabaaea37
Colors satisfy the Go color interface
2021-03-30 22:28:54 -04:00
Christian Rocha
9b77d4607b
Rename ColorType to TerminalColor
2021-03-30 22:19:38 -04:00
Christian Rocha
73f6cab6ac
Option to set whitespace color in place functions + whitespace renderer
2021-03-26 15:57:47 -04:00
Christian Rocha
a47a89f4ae
Remove setting for underlining and striking whitespace
2021-03-26 10:36:23 -04:00
Christian Rocha
a1f7fa9165
Expose the color profile Termenv detected
2021-03-18 14:52:44 -04:00
Christian Rocha
552799ac29
Improve NoColor primative
2021-03-18 14:34:39 -04:00
Christian Rocha
46dd8fbcc3
Switch to a method-based API
2021-03-04 12:54:40 -05:00
Christian Rocha
5913a9b105
Actually, use sync.Once to do termenv queries
2021-03-03 19:23:52 -05:00
Christian Rocha
30f46c0e58
Check hasDarkBackground on init only to prevent lockups
2021-03-03 19:00:51 -05:00
Christian Rocha
5c53233775
Initial commit. Add the nuts and bolts.
2021-03-01 18:29:00 -05:00