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

Ad-hoc changing the colours + document this in the README #62

Open
rubyFeedback opened this issue Apr 2, 2023 · 0 comments
Open

Ad-hoc changing the colours + document this in the README #62

rubyFeedback opened this issue Apr 2, 2023 · 0 comments

Comments

@rubyFeedback
Copy link

rubyFeedback commented Apr 2, 2023

What if all APIs, such as UnicodePlot.barplot(), also support an argument called colors?

For instance:

UnicodePlot.barplot(data: {'foo': 20, 'bar': 50}, colors: "steelblue").render

This would use steelblue rather than green (the default).

Right now this leads to an error:

.gem/gems/unicode_plot-0.0.5/lib/unicode_plot/plot.rb:10:in `initialize': unknown
 keyword: :colors (ArgumentError)

We could also fine-tune this perhaps ... if colors: is too generic, we could say
main_color: or foreground_color or color1: color2: and so on. Being able to
pass it in directly via a Hash is the important part here. That way we can
fine-tune the APIs here, to different use cases. Perhaps even to render them
as HTML "strings" (e. g. via CSS actually; my idea here is to allow for this
to be used in a web-page as-is, a "drop in" replacement).

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