Skip to content

Function: contrastOf() ​

ts
function contrastOf(c, background?): RGBA;

Experimental

Plotly's Color.contrast: white over dark colors, #444 over light ones (translucent colors are composited over background first: white in Plotly).

Parameters ​

ParameterTypeDefault value
cRGBAundefined
backgroundRGBAWHITE

Returns ​

RGBA

Released under the MIT License.