ABSTRACT

The JavaScript library underlying plotly (plotly.js) has its own support for specifying colors, which is different from how R specifies colors. It currently supports: hex, rgb, rgba, hsl, hsv, and named CSS3 colors. If people are doing something specific to R, like using ggplotly() and/or the top-level color/colors/stroke/strokes argument in plot_ly(), they will need to be careful about specifying colors in a way that R and plotly can understand. The color space package provides a nice way to create colors in any of these color spaces and provides a hex() function that one can use to convert any color to a hexadecimal format.