Commit Graph

17 Commits

Author SHA1 Message Date
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