This module implements the HCG (Hue, Chroma, Grayness) color space.
If you use NPM,
npm install d3-hcg. Otherwise, download the latest release. You can also load directly from d3js.org as a standalone library. AMD, CommonJS, and vanilla environments are supported. In vanilla, a
d3 global is exported:
Constructs a new HCG color. The channel values are exposed as
g properties on the returned instance.
If h, c and g are specified, these represent the channel values of the returned color; an opacity may also be specified. If a CSS Color Module Level 3 specifier string is specified, it is parsed and then converted to the HCG color space. See d3.color for examples. If a color instance is specified, it is converted to the RGB color space using color.rgb and then converted to HCG.