Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
if all the categories are valid CSS colors and no range or scheme has been set, the scale type defaults to identity.
Ref: https://talk.observablehq.com/t/specific-coloring-for-bar-plots/5996
Note that with this PR, you can still be surprised by "wrong colors": if any of the channels has an undefined value, the colors will switch back to tableau10. The user needs to use explicit colors everywhere for it to work.
I filed a commit with unit tests and another one with the implementation, because I initially had an alternative implementation where a domain comprised only of valid CSS colors would be promoted to the default range of a categorical scale.