colorizr 2.0.0-2 → 2.1.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +27 -27
- package/esm/brightness-difference.js +7 -7
- package/esm/brightness-difference.js.map +1 -1
- package/esm/chroma.js +5 -5
- package/esm/chroma.js.map +1 -1
- package/esm/color-difference.js +5 -5
- package/esm/color-difference.js.map +1 -1
- package/esm/compare.js +15 -15
- package/esm/compare.js.map +1 -1
- package/esm/contrast.js +8 -13
- package/esm/contrast.js.map +1 -1
- package/esm/darken.js +2 -3
- package/esm/darken.js.map +1 -1
- package/esm/desaturate.js +2 -3
- package/esm/desaturate.js.map +1 -1
- package/esm/fade.js +12 -14
- package/esm/fade.js.map +1 -1
- package/esm/format-css.js +10 -11
- package/esm/format-css.js.map +1 -1
- package/esm/format-hex.js +7 -7
- package/esm/format-hex.js.map +1 -1
- package/esm/hex2hsl.js +2 -2
- package/esm/hex2hsl.js.map +1 -1
- package/esm/hex2rgb.js +3 -3
- package/esm/hex2rgb.js.map +1 -1
- package/esm/hsl2hex.js +2 -2
- package/esm/hsl2hex.js.map +1 -1
- package/esm/hsl2rgb.d.ts +1 -1
- package/esm/hsl2rgb.js +13 -13
- package/esm/hsl2rgb.js.map +1 -1
- package/esm/index.d.ts +11 -12
- package/esm/index.js +99 -133
- package/esm/index.js.map +1 -1
- package/esm/is-valid-color.d.ts +1 -1
- package/esm/is-valid-color.js +1 -1
- package/esm/is-valid-color.js.map +1 -1
- package/esm/is-valid-hex.d.ts +1 -1
- package/esm/is-valid-hex.js +6 -3
- package/esm/is-valid-hex.js.map +1 -1
- package/esm/lighten.js +2 -3
- package/esm/lighten.js.map +1 -1
- package/esm/luminance.js +8 -8
- package/esm/luminance.js.map +1 -1
- package/esm/{utils.d.ts → modules/css-colors.d.ts} +0 -61
- package/esm/modules/css-colors.js +153 -0
- package/esm/modules/css-colors.js.map +1 -0
- package/esm/{hue2rgb.d.ts → modules/hue2rgb.d.ts} +0 -0
- package/esm/{hue2rgb.js → modules/hue2rgb.js} +2 -2
- package/esm/modules/hue2rgb.js.map +1 -0
- package/{lib → esm/modules}/parse-color.d.ts +1 -1
- package/esm/{parse-color.js → modules/parse-color.js} +12 -12
- package/esm/modules/parse-color.js.map +1 -0
- package/esm/{updater.d.ts → modules/updater.d.ts} +0 -0
- package/esm/modules/updater.js +19 -0
- package/esm/modules/updater.js.map +1 -0
- package/esm/modules/utils.d.ts +61 -0
- package/esm/modules/utils.js +199 -0
- package/esm/modules/utils.js.map +1 -0
- package/esm/name.js +5 -7
- package/esm/name.js.map +1 -1
- package/esm/palette.js +15 -27
- package/esm/palette.js.map +1 -1
- package/esm/parse-css.d.ts +1 -1
- package/esm/parse-css.js +13 -11
- package/esm/parse-css.js.map +1 -1
- package/esm/random.js +1 -1
- package/esm/random.js.map +1 -1
- package/esm/rgb2hex.d.ts +1 -1
- package/esm/rgb2hex.js +11 -11
- package/esm/rgb2hex.js.map +1 -1
- package/esm/rgb2hsl.d.ts +1 -1
- package/esm/rgb2hsl.js +14 -14
- package/esm/rgb2hsl.js.map +1 -1
- package/esm/rotate.js +6 -7
- package/esm/rotate.js.map +1 -1
- package/esm/saturate.js +2 -3
- package/esm/saturate.js.map +1 -1
- package/esm/scheme.d.ts +1 -1
- package/esm/scheme.js +12 -26
- package/esm/scheme.js.map +1 -1
- package/esm/shift.js +5 -16
- package/esm/shift.js.map +1 -1
- package/esm/text-color.js +4 -4
- package/esm/text-color.js.map +1 -1
- package/lib/brightness-difference.js +10 -10
- package/lib/brightness-difference.js.map +1 -1
- package/lib/chroma.js +8 -8
- package/lib/chroma.js.map +1 -1
- package/lib/color-difference.js +7 -7
- package/lib/color-difference.js.map +1 -1
- package/lib/compare.js +18 -18
- package/lib/compare.js.map +1 -1
- package/lib/contrast.js +10 -15
- package/lib/contrast.js.map +1 -1
- package/lib/darken.js +3 -4
- package/lib/darken.js.map +1 -1
- package/lib/desaturate.js +3 -4
- package/lib/desaturate.js.map +1 -1
- package/lib/fade.js +14 -16
- package/lib/fade.js.map +1 -1
- package/lib/format-css.js +16 -17
- package/lib/format-css.js.map +1 -1
- package/lib/format-hex.js +8 -8
- package/lib/format-hex.js.map +1 -1
- package/lib/hex2hsl.js +5 -5
- package/lib/hex2hsl.js.map +1 -1
- package/lib/hex2rgb.js +4 -4
- package/lib/hex2rgb.js.map +1 -1
- package/lib/hsl2hex.js +5 -5
- package/lib/hsl2hex.js.map +1 -1
- package/lib/hsl2rgb.d.ts +1 -1
- package/lib/hsl2rgb.js +16 -16
- package/lib/hsl2rgb.js.map +1 -1
- package/lib/index.d.ts +11 -12
- package/lib/index.js +135 -164
- package/lib/index.js.map +1 -1
- package/lib/is-valid-color.d.ts +1 -1
- package/lib/is-valid-color.js +3 -3
- package/lib/is-valid-color.js.map +1 -1
- package/lib/is-valid-hex.d.ts +1 -1
- package/lib/is-valid-hex.js +7 -4
- package/lib/is-valid-hex.js.map +1 -1
- package/lib/lighten.js +3 -4
- package/lib/lighten.js.map +1 -1
- package/lib/luminance.js +11 -11
- package/lib/luminance.js.map +1 -1
- package/lib/{utils.d.ts → modules/css-colors.d.ts} +0 -61
- package/lib/modules/css-colors.js +156 -0
- package/lib/modules/css-colors.js.map +1 -0
- package/lib/{hue2rgb.d.ts → modules/hue2rgb.d.ts} +0 -0
- package/lib/modules/hue2rgb.js +28 -0
- package/lib/modules/hue2rgb.js.map +1 -0
- package/{esm → lib/modules}/parse-color.d.ts +1 -1
- package/lib/modules/parse-color.js +59 -0
- package/lib/modules/parse-color.js.map +1 -0
- package/lib/{updater.d.ts → modules/updater.d.ts} +0 -0
- package/lib/modules/updater.js +22 -0
- package/lib/modules/updater.js.map +1 -0
- package/lib/modules/utils.d.ts +61 -0
- package/lib/modules/utils.js +215 -0
- package/lib/modules/utils.js.map +1 -0
- package/lib/name.js +6 -8
- package/lib/name.js.map +1 -1
- package/lib/palette.js +19 -31
- package/lib/palette.js.map +1 -1
- package/lib/parse-css.d.ts +1 -1
- package/lib/parse-css.js +26 -24
- package/lib/parse-css.js.map +1 -1
- package/lib/random.js +3 -3
- package/lib/random.js.map +1 -1
- package/lib/rgb2hex.d.ts +1 -1
- package/lib/rgb2hex.js +12 -12
- package/lib/rgb2hex.js.map +1 -1
- package/lib/rgb2hsl.d.ts +1 -1
- package/lib/rgb2hsl.js +14 -14
- package/lib/rgb2hsl.js.map +1 -1
- package/lib/rotate.js +11 -12
- package/lib/rotate.js.map +1 -1
- package/lib/saturate.js +3 -4
- package/lib/saturate.js.map +1 -1
- package/lib/scheme.d.ts +1 -1
- package/lib/scheme.js +14 -28
- package/lib/scheme.js.map +1 -1
- package/lib/shift.js +7 -18
- package/lib/shift.js.map +1 -1
- package/lib/text-color.js +6 -6
- package/lib/text-color.js.map +1 -1
- package/package.json +34 -43
- package/src/brightness-difference.ts +3 -3
- package/src/chroma.ts +2 -2
- package/src/color-difference.ts +3 -3
- package/src/compare.ts +3 -4
- package/src/contrast.ts +8 -12
- package/src/darken.ts +1 -1
- package/src/desaturate.ts +1 -1
- package/src/fade.ts +4 -4
- package/src/format-css.ts +3 -3
- package/src/format-hex.ts +4 -4
- package/src/hex2hsl.ts +2 -3
- package/src/hex2rgb.ts +2 -3
- package/src/hsl2hex.ts +2 -3
- package/src/hsl2rgb.ts +5 -6
- package/src/index.ts +14 -19
- package/src/is-valid-color.ts +2 -2
- package/src/is-valid-hex.ts +7 -3
- package/src/lighten.ts +1 -1
- package/src/luminance.ts +6 -6
- package/src/modules/css-colors.ts +152 -0
- package/src/{hue2rgb.ts → modules/hue2rgb.ts} +1 -4
- package/src/{parse-color.ts → modules/parse-color.ts} +11 -11
- package/src/{updater.ts → modules/updater.ts} +6 -5
- package/src/modules/utils.ts +253 -0
- package/src/name.ts +3 -2
- package/src/palette.ts +9 -8
- package/src/parse-css.ts +9 -7
- package/src/rgb2hex.ts +4 -5
- package/src/rgb2hsl.ts +4 -5
- package/src/rotate.ts +3 -3
- package/src/saturate.ts +1 -1
- package/src/scheme.ts +11 -23
- package/src/shift.ts +4 -5
- package/src/text-color.ts +2 -2
- package/src/types/index.ts +1 -0
- package/esm/hue2rgb.js.map +0 -1
- package/esm/parse-color.js.map +0 -1
- package/esm/updater.js +0 -20
- package/esm/updater.js.map +0 -1
- package/esm/utils.js +0 -360
- package/esm/utils.js.map +0 -1
- package/lib/hue2rgb.js +0 -28
- package/lib/hue2rgb.js.map +0 -1
- package/lib/parse-color.js +0 -59
- package/lib/parse-color.js.map +0 -1
- package/lib/updater.js +0 -23
- package/lib/updater.js.map +0 -1
- package/lib/utils.js +0 -376
- package/lib/utils.js.map +0 -1
- package/src/utils.ts +0 -412
package/lib/index.js
CHANGED
|
@@ -1,7 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
3
|
if (k2 === undefined) k2 = k;
|
|
4
|
-
Object.
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
5
9
|
}) : (function(o, m, k, k2) {
|
|
6
10
|
if (k2 === undefined) k2 = k;
|
|
7
11
|
o[k2] = m[k];
|
|
@@ -10,204 +14,161 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
|
10
14
|
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
11
15
|
};
|
|
12
16
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
13
|
-
exports.
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
var text_color_1 = require("./text-color");
|
|
37
|
-
exports.textColor = text_color_1.default;
|
|
38
|
-
var Colorizr = /** @class */ (function () {
|
|
39
|
-
function Colorizr(color, options) {
|
|
40
|
-
if (options === void 0) { options = {}; }
|
|
41
|
-
utils_1.invariant(!color, 'color is required');
|
|
42
|
-
var _a = options.model, model = _a === void 0 ? 'rgb' : _a;
|
|
43
|
-
var _b = parse_color_1.default(color), hex = _b.hex, hsl = _b.hsl, rgb = _b.rgb;
|
|
17
|
+
exports.textColor = exports.scheme = exports.saturate = exports.rotate = exports.rgb2hsl = exports.rgb2hex = exports.random = exports.parseCSS = exports.palette = exports.name = exports.luminance = exports.lighten = exports.isValidHex = exports.isValidColor = exports.hsl2rgb = exports.hsl2hex = exports.hex2rgb = exports.hex2hsl = exports.formatHex = exports.formatCSS = exports.fade = exports.desaturate = exports.darken = exports.contrast = exports.compare = exports.colorDifference = exports.chroma = exports.brightnessDifference = void 0;
|
|
18
|
+
const chroma_1 = require("./chroma");
|
|
19
|
+
const compare_1 = require("./compare");
|
|
20
|
+
const darken_1 = require("./darken");
|
|
21
|
+
const desaturate_1 = require("./desaturate");
|
|
22
|
+
const fade_1 = require("./fade");
|
|
23
|
+
const format_css_1 = require("./format-css");
|
|
24
|
+
const lighten_1 = require("./lighten");
|
|
25
|
+
const luminance_1 = require("./luminance");
|
|
26
|
+
const parse_color_1 = require("./modules/parse-color");
|
|
27
|
+
const utils_1 = require("./modules/utils");
|
|
28
|
+
const rotate_1 = require("./rotate");
|
|
29
|
+
const saturate_1 = require("./saturate");
|
|
30
|
+
const text_color_1 = require("./text-color");
|
|
31
|
+
class Colorizr {
|
|
32
|
+
hex;
|
|
33
|
+
model;
|
|
34
|
+
hsl;
|
|
35
|
+
rgb;
|
|
36
|
+
constructor(color, options = {}) {
|
|
37
|
+
(0, utils_1.invariant)(!!color, 'color is required');
|
|
38
|
+
const { model = 'rgb' } = options;
|
|
39
|
+
const { hex, hsl, rgb } = (0, parse_color_1.default)(color);
|
|
44
40
|
this.model = model;
|
|
45
41
|
this.hex = hex;
|
|
46
42
|
this.hsl = hsl;
|
|
47
43
|
this.rgb = rgb;
|
|
48
44
|
}
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
}
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
}
|
|
109
|
-
Object.defineProperty(Colorizr.prototype, "lightness", {
|
|
110
|
-
/**
|
|
111
|
-
* Get the lightness value
|
|
112
|
-
*/
|
|
113
|
-
get: function () {
|
|
114
|
-
return Number(this.hsl.l);
|
|
115
|
-
},
|
|
116
|
-
enumerable: false,
|
|
117
|
-
configurable: true
|
|
118
|
-
});
|
|
119
|
-
Object.defineProperty(Colorizr.prototype, "luminance", {
|
|
120
|
-
/**
|
|
121
|
-
* Get the luminance value
|
|
122
|
-
*/
|
|
123
|
-
get: function () {
|
|
124
|
-
return luminance_1.default(this.hex);
|
|
125
|
-
},
|
|
126
|
-
enumerable: false,
|
|
127
|
-
configurable: true
|
|
128
|
-
});
|
|
129
|
-
Object.defineProperty(Colorizr.prototype, "chroma", {
|
|
130
|
-
/**
|
|
131
|
-
* Get the chroma value
|
|
132
|
-
*/
|
|
133
|
-
get: function () {
|
|
134
|
-
return chroma_1.default(this.hex);
|
|
135
|
-
},
|
|
136
|
-
enumerable: false,
|
|
137
|
-
configurable: true
|
|
138
|
-
});
|
|
139
|
-
Object.defineProperty(Colorizr.prototype, "textColor", {
|
|
140
|
-
/**
|
|
141
|
-
* Get the contrasted color
|
|
142
|
-
*/
|
|
143
|
-
get: function () {
|
|
144
|
-
return text_color_1.default(this.hex);
|
|
145
|
-
},
|
|
146
|
-
enumerable: false,
|
|
147
|
-
configurable: true
|
|
148
|
-
});
|
|
45
|
+
/**
|
|
46
|
+
* Get css string
|
|
47
|
+
*/
|
|
48
|
+
get css() {
|
|
49
|
+
return (0, format_css_1.default)(this.hsl, { model: this.model });
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Get the red value
|
|
53
|
+
*/
|
|
54
|
+
get red() {
|
|
55
|
+
return Number(this.rgb.r);
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get the green value
|
|
59
|
+
*/
|
|
60
|
+
get green() {
|
|
61
|
+
return Number(this.rgb.g);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* Get the blue value
|
|
65
|
+
*/
|
|
66
|
+
get blue() {
|
|
67
|
+
return Number(this.rgb.b);
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get the hue value
|
|
71
|
+
*/
|
|
72
|
+
get hue() {
|
|
73
|
+
return Number(this.hsl.h);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Get the saturation value
|
|
77
|
+
*/
|
|
78
|
+
get saturation() {
|
|
79
|
+
return Number(this.hsl.s);
|
|
80
|
+
}
|
|
81
|
+
/**
|
|
82
|
+
* Get the lightness value
|
|
83
|
+
*/
|
|
84
|
+
get lightness() {
|
|
85
|
+
return Number(this.hsl.l);
|
|
86
|
+
}
|
|
87
|
+
/**
|
|
88
|
+
* Get the luminance value
|
|
89
|
+
*/
|
|
90
|
+
get luminance() {
|
|
91
|
+
return (0, luminance_1.default)(this.hex);
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the chroma value
|
|
95
|
+
*/
|
|
96
|
+
get chroma() {
|
|
97
|
+
return (0, chroma_1.default)(this.hex);
|
|
98
|
+
}
|
|
99
|
+
/**
|
|
100
|
+
* Get the contrasted color
|
|
101
|
+
*/
|
|
102
|
+
get textColor() {
|
|
103
|
+
return (0, text_color_1.default)(this.hex);
|
|
104
|
+
}
|
|
149
105
|
/**
|
|
150
106
|
* Test 2 colors for compliance
|
|
151
107
|
*/
|
|
152
|
-
|
|
153
|
-
return compare_1.default(this.hex, input);
|
|
154
|
-
}
|
|
108
|
+
compare(input) {
|
|
109
|
+
return (0, compare_1.default)(this.hex, input);
|
|
110
|
+
}
|
|
155
111
|
/**
|
|
156
112
|
* Increase lightness
|
|
157
113
|
*/
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
};
|
|
114
|
+
lighten(percentage = 10) {
|
|
115
|
+
return (0, lighten_1.default)(this.hex, percentage);
|
|
116
|
+
}
|
|
162
117
|
/**
|
|
163
118
|
* Decrease lightness
|
|
164
119
|
*/
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
};
|
|
120
|
+
darken(percentage = 10) {
|
|
121
|
+
return (0, darken_1.default)(this.hex, percentage);
|
|
122
|
+
}
|
|
169
123
|
/**
|
|
170
124
|
* Increase saturation
|
|
171
125
|
*/
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
};
|
|
126
|
+
saturate(percentage = 10) {
|
|
127
|
+
return (0, saturate_1.default)(this.hex, percentage);
|
|
128
|
+
}
|
|
176
129
|
/**
|
|
177
130
|
* Decrease saturation
|
|
178
131
|
*/
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
};
|
|
132
|
+
desaturate(percentage = 10) {
|
|
133
|
+
return (0, desaturate_1.default)(this.hex, percentage);
|
|
134
|
+
}
|
|
183
135
|
/**
|
|
184
136
|
* Invert color
|
|
185
137
|
*/
|
|
186
|
-
|
|
187
|
-
return rotate_1.default(this.hex, 180);
|
|
188
|
-
}
|
|
138
|
+
invert() {
|
|
139
|
+
return (0, rotate_1.default)(this.hex, 180);
|
|
140
|
+
}
|
|
189
141
|
/**
|
|
190
142
|
* Rotate color
|
|
191
143
|
*/
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
};
|
|
144
|
+
rotate(degrees = 15) {
|
|
145
|
+
return (0, rotate_1.default)(this.hex, degrees);
|
|
146
|
+
}
|
|
196
147
|
/**
|
|
197
148
|
* Fade color
|
|
198
149
|
*/
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
return Colorizr;
|
|
204
|
-
}());
|
|
150
|
+
fade(percentage = 10) {
|
|
151
|
+
return (0, fade_1.default)(this.hex, percentage, this.model);
|
|
152
|
+
}
|
|
153
|
+
}
|
|
205
154
|
var brightness_difference_1 = require("./brightness-difference");
|
|
206
155
|
Object.defineProperty(exports, "brightnessDifference", { enumerable: true, get: function () { return brightness_difference_1.default; } });
|
|
156
|
+
var chroma_2 = require("./chroma");
|
|
157
|
+
Object.defineProperty(exports, "chroma", { enumerable: true, get: function () { return chroma_2.default; } });
|
|
207
158
|
var color_difference_1 = require("./color-difference");
|
|
208
159
|
Object.defineProperty(exports, "colorDifference", { enumerable: true, get: function () { return color_difference_1.default; } });
|
|
160
|
+
var compare_2 = require("./compare");
|
|
161
|
+
Object.defineProperty(exports, "compare", { enumerable: true, get: function () { return compare_2.default; } });
|
|
209
162
|
var contrast_1 = require("./contrast");
|
|
210
163
|
Object.defineProperty(exports, "contrast", { enumerable: true, get: function () { return contrast_1.default; } });
|
|
164
|
+
var darken_2 = require("./darken");
|
|
165
|
+
Object.defineProperty(exports, "darken", { enumerable: true, get: function () { return darken_2.default; } });
|
|
166
|
+
var desaturate_2 = require("./desaturate");
|
|
167
|
+
Object.defineProperty(exports, "desaturate", { enumerable: true, get: function () { return desaturate_2.default; } });
|
|
168
|
+
var fade_2 = require("./fade");
|
|
169
|
+
Object.defineProperty(exports, "fade", { enumerable: true, get: function () { return fade_2.default; } });
|
|
170
|
+
var format_css_2 = require("./format-css");
|
|
171
|
+
Object.defineProperty(exports, "formatCSS", { enumerable: true, get: function () { return format_css_2.default; } });
|
|
211
172
|
var format_hex_1 = require("./format-hex");
|
|
212
173
|
Object.defineProperty(exports, "formatHex", { enumerable: true, get: function () { return format_hex_1.default; } });
|
|
213
174
|
var hex2hsl_1 = require("./hex2hsl");
|
|
@@ -222,6 +183,10 @@ var is_valid_color_1 = require("./is-valid-color");
|
|
|
222
183
|
Object.defineProperty(exports, "isValidColor", { enumerable: true, get: function () { return is_valid_color_1.default; } });
|
|
223
184
|
var is_valid_hex_1 = require("./is-valid-hex");
|
|
224
185
|
Object.defineProperty(exports, "isValidHex", { enumerable: true, get: function () { return is_valid_hex_1.default; } });
|
|
186
|
+
var lighten_2 = require("./lighten");
|
|
187
|
+
Object.defineProperty(exports, "lighten", { enumerable: true, get: function () { return lighten_2.default; } });
|
|
188
|
+
var luminance_2 = require("./luminance");
|
|
189
|
+
Object.defineProperty(exports, "luminance", { enumerable: true, get: function () { return luminance_2.default; } });
|
|
225
190
|
var name_1 = require("./name");
|
|
226
191
|
Object.defineProperty(exports, "name", { enumerable: true, get: function () { return name_1.default; } });
|
|
227
192
|
var palette_1 = require("./palette");
|
|
@@ -234,8 +199,14 @@ var rgb2hex_1 = require("./rgb2hex");
|
|
|
234
199
|
Object.defineProperty(exports, "rgb2hex", { enumerable: true, get: function () { return rgb2hex_1.default; } });
|
|
235
200
|
var rgb2hsl_1 = require("./rgb2hsl");
|
|
236
201
|
Object.defineProperty(exports, "rgb2hsl", { enumerable: true, get: function () { return rgb2hsl_1.default; } });
|
|
202
|
+
var rotate_2 = require("./rotate");
|
|
203
|
+
Object.defineProperty(exports, "rotate", { enumerable: true, get: function () { return rotate_2.default; } });
|
|
204
|
+
var saturate_2 = require("./saturate");
|
|
205
|
+
Object.defineProperty(exports, "saturate", { enumerable: true, get: function () { return saturate_2.default; } });
|
|
237
206
|
var scheme_1 = require("./scheme");
|
|
238
207
|
Object.defineProperty(exports, "scheme", { enumerable: true, get: function () { return scheme_1.default; } });
|
|
208
|
+
var text_color_2 = require("./text-color");
|
|
209
|
+
Object.defineProperty(exports, "textColor", { enumerable: true, get: function () { return text_color_2.default; } });
|
|
239
210
|
__exportStar(require("./types"), exports);
|
|
240
211
|
exports.default = Colorizr;
|
|
241
212
|
//# sourceMappingURL=index.js.map
|
package/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;AAAA,qCAA8B;AAC9B,uCAAgC;AAChC,qCAA8B;AAC9B,6CAAsC;AACtC,iCAA0B;AAC1B,6CAAqC;AACrC,uCAAgC;AAChC,2CAAoC;AACpC,uDAA+C;AAC/C,2CAA4C;AAC5C,qCAA8B;AAC9B,yCAAkC;AAClC,6CAAqC;AAGrC,MAAM,QAAQ;IACL,GAAG,CAAS;IACF,KAAK,CAAmB;IAClC,GAAG,CAAM;IACT,GAAG,CAAM;IAEhB,YAAY,KAAoC,EAAE,UAAmB,EAAE;QACrE,IAAA,iBAAS,EAAC,CAAC,CAAC,KAAK,EAAE,mBAAmB,CAAC,CAAC;QAExC,MAAM,EAAE,KAAK,GAAG,KAAK,EAAE,GA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
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isValidColor(input:
|
|
1
|
+
export default function isValidColor(input: unknown): boolean;
|
package/lib/is-valid-color.js
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const parse_css_1 = require("./parse-css");
|
|
4
4
|
function isValidColor(input) {
|
|
5
5
|
try {
|
|
6
|
-
parse_css_1.default(input);
|
|
6
|
+
(0, parse_css_1.default)(input);
|
|
7
7
|
return true;
|
|
8
8
|
}
|
|
9
|
-
catch
|
|
9
|
+
catch {
|
|
10
10
|
return false;
|
|
11
11
|
}
|
|
12
12
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-valid-color.js","sourceRoot":"","sources":["../src/is-valid-color.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"is-valid-color.js","sourceRoot":"","sources":["../src/is-valid-color.ts"],"names":[],"mappings":";;AAAA,2CAAmC;AAEnC,SAAwB,YAAY,CAAC,KAAc;IACjD,IAAI;QACF,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC;QAEhB,OAAO,IAAI,CAAC;KACb;IAAC,MAAM;QACN,OAAO,KAAK,CAAC;KACd;AACH,CAAC;AARD,+BAQC"}
|
package/lib/is-valid-hex.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export default function isValidHex(input: any): boolean;
|
|
1
|
+
export default function isValidHex(input: any, alpha?: boolean): boolean;
|
package/lib/is-valid-hex.js
CHANGED
|
@@ -1,11 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
function isValidHex(input) {
|
|
5
|
-
if (!utils_1.isString(input)) {
|
|
3
|
+
const utils_1 = require("./modules/utils");
|
|
4
|
+
function isValidHex(input, alpha = true) {
|
|
5
|
+
if (!(0, utils_1.isString)(input)) {
|
|
6
6
|
return false;
|
|
7
7
|
}
|
|
8
|
-
|
|
8
|
+
if (alpha) {
|
|
9
|
+
return /^#([\da-f]{3,4}|[\da-f]{6,8})$/i.test(input);
|
|
10
|
+
}
|
|
11
|
+
return /^#([\da-f]{3}|[\da-f]{6})$/i.test(input);
|
|
9
12
|
}
|
|
10
13
|
exports.default = isValidHex;
|
|
11
14
|
//# sourceMappingURL=is-valid-hex.js.map
|
package/lib/is-valid-hex.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"is-valid-hex.js","sourceRoot":"","sources":["../src/is-valid-hex.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"is-valid-hex.js","sourceRoot":"","sources":["../src/is-valid-hex.ts"],"names":[],"mappings":";;AAAA,2CAA2C;AAE3C,SAAwB,UAAU,CAAC,KAAU,EAAE,KAAK,GAAG,IAAI;IACzD,IAAI,CAAC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAE;QACpB,OAAO,KAAK,CAAC;KACd;IAED,IAAI,KAAK,EAAE;QACT,OAAO,iCAAiC,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;KACtD;IAED,OAAO,6BAA6B,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;AACnD,CAAC;AAVD,6BAUC"}
|
package/lib/lighten.js
CHANGED
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
3
|
+
const updater_1 = require("./modules/updater");
|
|
4
4
|
/**
|
|
5
5
|
* Increase color lightness
|
|
6
6
|
*/
|
|
7
|
-
function lighten(input, amount) {
|
|
8
|
-
|
|
9
|
-
return updater_1.default('l', '+')(input, amount);
|
|
7
|
+
function lighten(input, amount = 10) {
|
|
8
|
+
return (0, updater_1.default)('l', '+')(input, amount);
|
|
10
9
|
}
|
|
11
10
|
exports.default = lighten;
|
|
12
11
|
//# sourceMappingURL=lighten.js.map
|
package/lib/lighten.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"lighten.js","sourceRoot":"","sources":["../src/lighten.ts"],"names":[],"mappings":";;AAAA
|
|
1
|
+
{"version":3,"file":"lighten.js","sourceRoot":"","sources":["../src/lighten.ts"],"names":[],"mappings":";;AAAA,+CAAwC;AAExC;;GAEG;AACH,SAAwB,OAAO,CAAC,KAAa,EAAE,MAAM,GAAG,EAAE;IACxD,OAAO,IAAA,iBAAO,EAAC,GAAG,EAAE,GAAG,CAAC,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;AAC1C,CAAC;AAFD,0BAEC"}
|
package/lib/luminance.js
CHANGED
|
@@ -1,24 +1,24 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
3
|
+
const hex2rgb_1 = require("./hex2rgb");
|
|
4
|
+
const utils_1 = require("./modules/utils");
|
|
5
|
+
const parse_css_1 = require("./parse-css");
|
|
6
6
|
/**
|
|
7
7
|
* Get the luminance of a color.
|
|
8
8
|
*/
|
|
9
9
|
function luminance(input) {
|
|
10
|
-
utils_1.invariant(
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
for (
|
|
14
|
-
if (rgb[
|
|
15
|
-
rgb[
|
|
10
|
+
(0, utils_1.invariant)((0, utils_1.isString)(input), utils_1.messages.inputString);
|
|
11
|
+
const { r, g, b } = (0, hex2rgb_1.default)((0, parse_css_1.default)(input));
|
|
12
|
+
const rgb = [r / 255, g / 255, b / 255];
|
|
13
|
+
for (let index = 0; index < rgb.length; index++) {
|
|
14
|
+
if (rgb[index] <= 0.03928) {
|
|
15
|
+
rgb[index] /= 12.92;
|
|
16
16
|
}
|
|
17
17
|
else {
|
|
18
|
-
rgb[
|
|
18
|
+
rgb[index] = ((rgb[index] + 0.055) / 1.055) ** 2.4;
|
|
19
19
|
}
|
|
20
20
|
}
|
|
21
|
-
return utils_1.round(0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2], 4);
|
|
21
|
+
return (0, utils_1.round)(0.2126 * rgb[0] + 0.7152 * rgb[1] + 0.0722 * rgb[2], 4);
|
|
22
22
|
}
|
|
23
23
|
exports.default = luminance;
|
|
24
24
|
//# sourceMappingURL=luminance.js.map
|
package/lib/luminance.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"luminance.js","sourceRoot":"","sources":["../src/luminance.ts"],"names":[],"mappings":";;AAAA,
|
|
1
|
+
{"version":3,"file":"luminance.js","sourceRoot":"","sources":["../src/luminance.ts"],"names":[],"mappings":";;AAAA,uCAAgC;AAChC,2CAAuE;AACvE,2CAAmC;AAEnC;;GAEG;AACH,SAAwB,SAAS,CAAC,KAAa;IAC7C,IAAA,iBAAS,EAAC,IAAA,gBAAQ,EAAC,KAAK,CAAC,EAAE,gBAAQ,CAAC,WAAW,CAAC,CAAC;IAEjD,MAAM,EAAE,CAAC,EAAE,CAAC,EAAE,CAAC,EAAE,GAAG,IAAA,iBAAO,EAAC,IAAA,mBAAQ,EAAC,KAAK,CAAC,CAAC,CAAC;IAE7C,MAAM,GAAG,GAAG,CAAC,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,EAAE,CAAC,GAAG,GAAG,CAAC,CAAC;IAExC,KAAK,IAAI,KAAK,GAAG,CAAC,EAAE,KAAK,GAAG,GAAG,CAAC,MAAM,EAAE,KAAK,EAAE,EAAE;QAC/C,IAAI,GAAG,CAAC,KAAK,CAAC,IAAI,OAAO,EAAE;YACzB,GAAG,CAAC,KAAK,CAAC,IAAI,KAAK,CAAC;SACrB;aAAM;YACL,GAAG,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,KAAK,CAAC,GAAG,KAAK,CAAC,GAAG,KAAK,CAAC,IAAI,GAAG,CAAC;SACpD;KACF;IAED,OAAO,IAAA,aAAK,EAAC,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,GAAG,MAAM,GAAG,GAAG,CAAC,CAAC,CAAC,EAAE,CAAC,CAAC,CAAC;AACvE,CAAC;AAhBD,4BAgBC"}
|
|
@@ -1,14 +1,3 @@
|
|
|
1
|
-
import { HSL, RGB, PlainObject, RGBArray } from './types';
|
|
2
|
-
export declare const HSLKeys: string[];
|
|
3
|
-
export declare const RGBKeys: string[];
|
|
4
|
-
/**
|
|
5
|
-
* Constrain value into the range
|
|
6
|
-
*/
|
|
7
|
-
export declare function constrain(input: number, amount: number, range: number[], sign: string): number;
|
|
8
|
-
/**
|
|
9
|
-
* Constrain an angle
|
|
10
|
-
*/
|
|
11
|
-
export declare function constrainDegrees(input: number, amount: number): number;
|
|
12
1
|
/**
|
|
13
2
|
* CSS named colors
|
|
14
3
|
*/
|
|
@@ -161,53 +150,3 @@ export declare const cssColors: {
|
|
|
161
150
|
yellow: string;
|
|
162
151
|
yellowgreen: string;
|
|
163
152
|
};
|
|
164
|
-
/**
|
|
165
|
-
* Parse math string expressions
|
|
166
|
-
*/
|
|
167
|
-
export declare function expr(input: string): number;
|
|
168
|
-
export declare function invariant(condition: boolean, message: string, a?: any, b?: any, c?: any, d?: any, e?: any, f?: any): void;
|
|
169
|
-
/**
|
|
170
|
-
* Check if an object contains HSL values
|
|
171
|
-
*/
|
|
172
|
-
export declare function isHSL(input: any): input is HSL;
|
|
173
|
-
/**
|
|
174
|
-
* Check if the input is a number and not NaN
|
|
175
|
-
*/
|
|
176
|
-
export declare function isNumber(input: any): input is number;
|
|
177
|
-
/**
|
|
178
|
-
* Check if the input is an object
|
|
179
|
-
*/
|
|
180
|
-
export declare function isPlainObject(input: any): input is PlainObject;
|
|
181
|
-
/**
|
|
182
|
-
* Check if an object contains RGB values.
|
|
183
|
-
*/
|
|
184
|
-
export declare function isRGB(input: any): input is RGB;
|
|
185
|
-
/**
|
|
186
|
-
* Check if an array contains RGB values.
|
|
187
|
-
*/
|
|
188
|
-
export declare function isRGBArray(input: any): input is RGBArray;
|
|
189
|
-
/**
|
|
190
|
-
* Check if the input is a string
|
|
191
|
-
*/
|
|
192
|
-
export declare function isString(input: any): input is string;
|
|
193
|
-
/**
|
|
194
|
-
* Limit values per type.
|
|
195
|
-
*/
|
|
196
|
-
export declare function limit(input: number, type: string): number;
|
|
197
|
-
export declare const messages: {
|
|
198
|
-
amount: string;
|
|
199
|
-
left: string;
|
|
200
|
-
right: string;
|
|
201
|
-
input: string;
|
|
202
|
-
inputString: string;
|
|
203
|
-
invalid: string;
|
|
204
|
-
options: string;
|
|
205
|
-
};
|
|
206
|
-
/**
|
|
207
|
-
* Creates an object composed of the picked source properties.
|
|
208
|
-
*/
|
|
209
|
-
export declare function pick(input: PlainObject, options: string[]): PlainObject;
|
|
210
|
-
/**
|
|
211
|
-
* Round decimal numbers.
|
|
212
|
-
*/
|
|
213
|
-
export declare function round(input: number, digits?: number): number;
|