Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

The ENV checking in print could be expensive #42

Open
KristofferC opened this issue Aug 31, 2020 · 0 comments
Open

The ENV checking in print could be expensive #42

KristofferC opened this issue Aug 31, 2020 · 0 comments

Comments

@KristofferC
Copy link
Owner

I designed that API when I was young and naive (... or something). What I am talking about is:

Alternatively, if the environment variable FORCE_COLOR exist, or Crayons.force_color(::Bool) has been enabled, color sequences are printed no matter what. Also, since relatively few terminals support full 24-bit colors, it is possible to activate 256 color mode which converts the 24-bit crayon to a 256 color crayon when printed. This is done by either defining the variable environment FORCE_256_COLORS or by calling Crayons.force_256_colors(::Bool). In addition, some systems have problems even with 256 colors, it is possible to convert to one of the 16 system colors by defining the variable FORCE_SYSTEM_COLORS or by calling Crayons.force_system_colors(::Bool).

These env variables are checked every time a Crayon is printed which is a system call etc. Should probablt deprecate these and figure out some other way of doing it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant