Package Exports
- d3plus-color
This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (d3plus-color) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.
Readme
d3plus-color
Color
Color functions that extent the ability of d3-color.
Kind: global class
- Color
- new Color(color, [defaults])
- .add(c2) ⇒
Color
- .displayable() ⇒
Boolean
- .hex() ⇒
String
- .hsl()
- .legible() ⇒
Color
- .lighter() ⇒
Color
- .rgb()
- .subtract(c2) ⇒
Color
- .text() ⇒
Color
- .toString() ⇒
String
new Color(color, [defaults])
Param | Type | Default |
---|---|---|
color | Color | String | Number | true | false | null | undefined |
|
[defaults] | object |
src/defaults.js |
color.add(c2) ⇒ Color
Mixes a second color, returning a new Color object.
Kind: instance method of Color
Param | Type | Description |
---|---|---|
c2 | Color |
The color to be mixed in. If it is not a d3plus-color Object, then it will be parsed into one. |
color.displayable() ⇒ Boolean
Returns true if the color is displayable.
Kind: instance method of Color
color.hex() ⇒ String
Returns the hexidecimal value.
Kind: instance method of Color
color.hsl()
Returns the D3 hsl object.
Kind: instance method of Color
color.legible() ⇒ Color
Darkens the color if it is too light to appear on white.
Kind: instance method of Color
color.lighter() ⇒ Color
Lightens the color while also reducing the saturation.
Kind: instance method of Color
color.rgb()
Returns the D3 rgb object.
Kind: instance method of Color
color.subtract(c2) ⇒ Color
Subtracts a second color, returning a new Color object.
Kind: instance method of Color
Param | Type | Description |
---|---|---|
c2 | Color |
The color to be subtracted out. If it is not a d3plus-color Object, then it will be parsed into one. |
color.text() ⇒ Color
Analyzes the color and determines an appropriate color for text to be placed on top of the color.
Kind: instance method of Color
color.toString() ⇒ String
Pass-through method for D3 toString function.
Kind: instance method of Color