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

Provide entry point for color customization #2683

Closed
Arkoniak opened this issue Aug 5, 2021 · 3 comments
Closed

Provide entry point for color customization #2683

Arkoniak opened this issue Aug 5, 2021 · 3 comments

Comments

@Arkoniak
Copy link

Arkoniak commented Aug 5, 2021

Pkg.jl uses hardcoded colors for generating output and unfortunately color choice is not always suitable for all users for various reasons.

I propose to use the following approach instead of colors hardcoding:

# define somewhere at the beginning

const COLOR = Ref((; foo = :red, bar = :green))

# and later in the code, when color is needed
printstyled("what you need to print", COLOR[].foo)

This simple change does not provide full-fledged color theme switching by itself (this probably should be implemented JuliaLang/julia#41435), but it provides an entry point for all future color theme related stuff. I.e. all user level convenience functions would just modify this variable one way or another. And anyway this proposal allows color customization right here and now (maybe slightly cumbersome) unlike the current situation.

Implementing this feature looks like a good beginner PR, doesn't require large modifications of the code base and it solves color issues.

@KristofferC
Copy link
Member

See JuliaLang/julia#41435

@Arkoniak
Copy link
Author

Arkoniak commented Aug 5, 2021

Yes, I've made reference to this issue in the topic itself. Since I do not want to duplicate answers, here is a link to a comment in different issue: JuliaLang/julia#41791 (comment)

I've made issue in Pkg.jl, since it looks like a different package and can be adjusted separately from main julia code base. If it's not the case, then I can close this issue.

@KristofferC
Copy link
Member

Sorry for not reading carefully. I think it is better that a proper interface is developed in julia base, and then we can adopt that.

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

2 participants