UNPKG
chromatism2
Version:
latest (3.0.2)
3.0.2
3.0.1
A simple set of utility functions for colours.
github.com/tehshrike/chromatism
tehshrike/chromatism
chromatism2
/
src
/
operations
/
complementary.js
11 lines
(7 loc)
•
258 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
import
convert
from
'../helpers/convert-to-type'
import
makeColourObject
from
'./convert'
export
default
function
complementary
(
colourRef
) {
var
colour =
convert
(
'hsl'
, colourRef) colour.
h
= (colour.
h
+
180
) %
360
return
makeColourObject
(colour) }