This concerns when we specify a value, as opposed to a field (variable) to map colors:
- ggplot2 accepts R colors:
colors()
- Vega-Lite accepts a css color
Fortunately hex colors, e.g. "#663399" are valid in both systems. The named colors also seem to be very similar - they both seem to derive from X11 colors.
Proposal for the TypeScript side of things:
- if the value begins with a
# and has six characters following, let it through as-is.
- if the value does not begin with a
#, remove any trailing numbers from the color.
This concerns when we specify a value, as opposed to a field (variable) to map colors:
colors()Fortunately hex colors, e.g.
"#663399"are valid in both systems. The named colors also seem to be very similar - they both seem to derive from X11 colors.Proposal for the TypeScript side of things:
#and has six characters following, let it through as-is.#, remove any trailing numbers from the color.