JuliaCI / JuliaCI/BenchmarkTools.jl
Provide entry point for color customization
Nobody has claimed this yet.
- Dominant language
- Julia
- Stars
- 684
- Forks
- 107
- PR merge metrics
- No merged PRs in 30d
Description
BenchmarkTools 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 https://github.com/JuliaLang/julia/issues/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.
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
Research direction
Start by locating the hardcoded colors used when BenchmarkTools generates output and review the proposed Julia Ref-based customization entry point in the issue. Done means color choices can be customized through that entry point without changing the existing output behavior by default.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- julia
- Domain
- tooling
- Issue type
- Feature
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 42/100