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

Consider indicating whether "black" color is explicitly specified or assigned as a default #40

Closed
madrev opened this issue Jun 12, 2023 · 1 comment · Fixed by #47
Closed

Comments

@madrev
Copy link

madrev commented Jun 12, 2023

In our application, we'd like to use the color defined in the format string if it is explicitly specified, falling back to some other default if not.

Unfortunately it seems numfmt returns black in both of these cases and there's no way to discern whether black has been explicitly specified for the given value or not. Formatter.info almost does this, but only for negative values.

Might you consider either providing more detail in formatter.info for the non-negative cases, or providing some metadata at format time to indicate whether black was specified?
More drastically, maybe it could not return black in the unspecified case? (I suppose this would be a breaking change).

Happy to try to cut a PR if we can agree on a direction.

@borgar
Copy link
Owner

borgar commented Jun 12, 2023

I think both having better details in info and not returning a value if none was specified are better than the current behavior is. 🙂 There is the possibility of having this as an option as well. I've done that for a few backwards incompatible things recently.

I am currently looking more critically at the library. There are a number of things that can be simplified quote a lot and so I may just do a breaking major version update and fix the color function.

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

Successfully merging a pull request may close this issue.

2 participants