color-util-helpers 1.0.6 → 1.0.7

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.
Files changed (47) hide show
  1. package/ng-package.json +8 -0
  2. package/package.json +2 -15
  3. package/src/lib/assets/picture.webp +0 -0
  4. package/src/lib/color-conversion.service.spec.ts +54 -0
  5. package/src/lib/color-conversion.service.ts +35 -0
  6. package/src/lib/color-extractor.directive.spec.ts +49 -0
  7. package/src/lib/color-extractor.directive.ts +28 -0
  8. package/src/lib/color-grab.directive.ts +204 -0
  9. package/src/lib/color-lighten-darken.service.spec.ts +61 -0
  10. package/src/lib/color-lighten-darken.service.ts +83 -0
  11. package/src/lib/color-pallette.service.spec.ts +85 -0
  12. package/src/lib/color-pallette.service.ts +191 -0
  13. package/src/lib/color-scheme.service.ts +123 -0
  14. package/src/lib/color-utilities-demo/color-utilities-demo.component.css +12 -0
  15. package/src/lib/color-utilities-demo/color-utilities-demo.component.html +109 -0
  16. package/src/lib/color-utilities-demo/color-utilities-demo.component.ts +57 -0
  17. package/src/lib/color-utils.module.ts +27 -0
  18. package/src/lib/text-color.service.spec.ts +75 -0
  19. package/src/lib/text-color.service.ts +101 -0
  20. package/{public-api.d.ts → src/public-api.ts} +6 -0
  21. package/tsconfig.lib.json +32 -0
  22. package/tsconfig.lib.prod.json +10 -0
  23. package/tsconfig.spec.json +14 -0
  24. package/color-util-helpers-1.0.6.tgz +0 -0
  25. package/esm2022/color-util-helpers.mjs +0 -5
  26. package/esm2022/lib/color-conversion.service.mjs +0 -39
  27. package/esm2022/lib/color-extractor.directive.mjs +0 -37
  28. package/esm2022/lib/color-grab.directive.mjs +0 -185
  29. package/esm2022/lib/color-lighten-darken.service.mjs +0 -79
  30. package/esm2022/lib/color-pallette.service.mjs +0 -172
  31. package/esm2022/lib/color-scheme.service.mjs +0 -113
  32. package/esm2022/lib/color-utilities-demo/color-utilities-demo.component.mjs +0 -41
  33. package/esm2022/lib/color-utils.module.mjs +0 -38
  34. package/esm2022/lib/text-color.service.mjs +0 -79
  35. package/esm2022/public-api.mjs +0 -13
  36. package/fesm2022/color-util-helpers.mjs +0 -767
  37. package/fesm2022/color-util-helpers.mjs.map +0 -1
  38. package/index.d.ts +0 -5
  39. package/lib/color-conversion.service.d.ts +0 -8
  40. package/lib/color-extractor.directive.d.ts +0 -13
  41. package/lib/color-grab.directive.d.ts +0 -31
  42. package/lib/color-lighten-darken.service.d.ts +0 -10
  43. package/lib/color-pallette.service.d.ts +0 -36
  44. package/lib/color-scheme.service.d.ts +0 -45
  45. package/lib/color-utilities-demo/color-utilities-demo.component.d.ts +0 -34
  46. package/lib/color-utils.module.d.ts +0 -12
  47. package/lib/text-color.service.d.ts +0 -18
@@ -1,767 +0,0 @@
1
- import * as i0 from '@angular/core';
2
- import { Directive, Input, Injectable, inject, Component, EventEmitter, Output, HostListener, NgModule } from '@angular/core';
3
- import * as i1 from '@angular/common';
4
- import { CommonModule } from '@angular/common';
5
- import { MatButtonModule } from '@angular/material/button';
6
- import * as i2 from '@angular/material/divider';
7
- import { MatDividerModule } from '@angular/material/divider';
8
- import { BehaviorSubject } from 'rxjs';
9
-
10
- class ColorGrabberDirective {
11
- constructor(el) {
12
- this.el = el;
13
- }
14
- ngOnInit() {
15
- const canvas = document.createElement('canvas');
16
- canvas.width = 1;
17
- canvas.height = 1;
18
- this.ctx = canvas.getContext('2d');
19
- const img = new Image();
20
- img.src = this.imageUrl || '';
21
- img.setAttribute('crossOrigin', '');
22
- img.onload = () => {
23
- this.ctx?.drawImage(img, 0, 0, 1, 1);
24
- const imageData = this.ctx?.getImageData(0, 0, 1, 1);
25
- if (imageData && imageData.data) {
26
- const i = imageData.data;
27
- const rgbColor = `rgba(${i[0]},${i[1]},${i[2]},${i[3]})`;
28
- const hexColor = "#" + ((1 << 24) + (i[0] << 16) + (i[1] << 8) + i[2]).toString(16).slice(1);
29
- const textColor = this.textColorBasedOnBgColor(hexColor, this.light, this.dark);
30
- const hsv = this.RGB2HSV({ r: i[0], g: i[1], b: i[2] });
31
- hsv.hue = this.HueShift(hsv.hue, 135.0);
32
- const secondaryColor = this.HSV2RGB(hsv);
33
- const highlightColor = this.lightenDarkenColor(secondaryColor.hex, 50);
34
- this.el.nativeElement.style.backgroundColor = rgbColor;
35
- this.el.nativeElement.style.color = textColor;
36
- }
37
- else {
38
- console.error("Failed to get image data.");
39
- }
40
- };
41
- }
42
- textColorBasedOnBgColor(bgColor, lightColor = '#FFFFFF', darkColor = '#000000') {
43
- const color = (bgColor.charAt(0) === '#') ? bgColor.substring(1, 7) : bgColor;
44
- const r = parseInt(color.substring(0, 2), 16); // hexToR
45
- const g = parseInt(color.substring(2, 4), 16); // hexToG
46
- const b = parseInt(color.substring(4, 6), 16); // hexToB
47
- const uicolors = [r / 255, g / 255, b / 255];
48
- const c = uicolors.map((col) => {
49
- if (col <= 0.03928)
50
- return col / 12.92;
51
- return Math.pow((col + 0.055) / 1.055, 2.4);
52
- });
53
- const L = (0.2126 * c[0]) + (0.7152 * c[1]) + (0.0722 * c[2]);
54
- return (L > 0.179) ? darkColor : lightColor;
55
- }
56
- RGB2HSV(rgb) {
57
- const hsv = { saturation: 0, hue: 0, value: 0 };
58
- const max = this.max3(rgb.r, rgb.g, rgb.b);
59
- const dif = max - this.min3(rgb.r, rgb.g, rgb.b);
60
- hsv.saturation = (max == 0.0) ? 0 : (100 * dif / max);
61
- if (hsv.saturation == 0) {
62
- hsv.hue = 0;
63
- }
64
- else if (rgb.r == max) {
65
- hsv.hue = 60.0 * (rgb.g - rgb.b) / dif;
66
- }
67
- else if (rgb.g == max) {
68
- hsv.hue = 120.0 + 60.0 * (rgb.b - rgb.r) / dif;
69
- }
70
- else if (rgb.b == max) {
71
- hsv.hue = 240.0 + 60.0 * (rgb.r - rgb.g) / dif;
72
- }
73
- if (hsv.hue < 0.0)
74
- hsv.hue += 360.0;
75
- hsv.value = Math.round(max * 100 / 255);
76
- hsv.hue = Math.round(hsv.hue);
77
- hsv.saturation = Math.round(hsv.saturation);
78
- return hsv;
79
- }
80
- HSV2RGB(hsv) {
81
- const rgb = { r: 0, g: 0, b: 0 };
82
- if (hsv.saturation == 0) {
83
- rgb.r = rgb.g = rgb.b = Math.round(hsv.value * 2.55);
84
- }
85
- else {
86
- hsv.hue /= 60;
87
- hsv.saturation /= 100;
88
- hsv.value /= 100;
89
- const i = Math.floor(hsv.hue);
90
- const f = hsv.hue - i;
91
- const p = hsv.value * (1 - hsv.saturation);
92
- const q = hsv.value * (1 - hsv.saturation * f);
93
- const t = hsv.value * (1 - hsv.saturation * (1 - f));
94
- switch (i) {
95
- case 0:
96
- rgb.r = hsv.value;
97
- rgb.g = t;
98
- rgb.b = p;
99
- break;
100
- case 1:
101
- rgb.r = q;
102
- rgb.g = hsv.value;
103
- rgb.b = p;
104
- break;
105
- case 2:
106
- rgb.r = p;
107
- rgb.g = hsv.value;
108
- rgb.b = t;
109
- break;
110
- case 3:
111
- rgb.r = p;
112
- rgb.g = q;
113
- rgb.b = hsv.value;
114
- break;
115
- case 4:
116
- rgb.r = t;
117
- rgb.g = p;
118
- rgb.b = hsv.value;
119
- break;
120
- default:
121
- rgb.r = hsv.value;
122
- rgb.g = p;
123
- rgb.b = q;
124
- }
125
- rgb.r = Math.round(rgb.r * 255);
126
- rgb.g = Math.round(rgb.g * 255);
127
- rgb.b = Math.round(rgb.b * 255);
128
- }
129
- const rgbColor = `rgba(${rgb.r},${rgb.g},${rgb.b},${1})`;
130
- const hexColor = "#" + ((1 << 24) + (rgb.r << 16) + (rgb.g << 8) + rgb.b).toString(16).slice(1);
131
- return { rgb: rgbColor, hex: hexColor };
132
- }
133
- HueShift(h, s) {
134
- h += s;
135
- while (h >= 360.0)
136
- h -= 360.0;
137
- while (h < 0.0)
138
- h += 360.0;
139
- return h;
140
- }
141
- min3(a, b, c) {
142
- return (a < b) ? ((a < c) ? a : c) : ((b < c) ? b : c);
143
- }
144
- max3(a, b, c) {
145
- return (a > b) ? ((a > c) ? a : c) : ((b > c) ? b : c);
146
- }
147
- lightenDarkenColor(colorCode, amount) {
148
- var usePound = false;
149
- if (colorCode[0] == "#") {
150
- colorCode = colorCode.slice(1);
151
- usePound = true;
152
- }
153
- var num = parseInt(colorCode, 16);
154
- var r = (num >> 16) + amount;
155
- if (r > 255) {
156
- r = 255;
157
- }
158
- else if (r < 0) {
159
- r = 0;
160
- }
161
- var b = ((num >> 8) & 0x00FF) + amount;
162
- if (b > 255) {
163
- b = 255;
164
- }
165
- else if (b < 0) {
166
- b = 0;
167
- }
168
- var g = (num & 0x0000FF) + amount;
169
- if (g > 255) {
170
- g = 255;
171
- }
172
- else if (g < 0) {
173
- g = 0;
174
- }
175
- return (usePound ? "#" : "") + (g | (b << 8) | (r << 16)).toString(16);
176
- }
177
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorGrabberDirective, deps: [{ token: i0.ElementRef }], target: i0.ɵɵFactoryTarget.Directive }); }
178
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColorGrabberDirective, selector: "[colorGrabber]", inputs: { imageUrl: "imageUrl", light: "light", dark: "dark" }, ngImport: i0 }); }
179
- }
180
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorGrabberDirective, decorators: [{
181
- type: Directive,
182
- args: [{
183
- selector: '[colorGrabber]'
184
- }]
185
- }], ctorParameters: function () { return [{ type: i0.ElementRef }]; }, propDecorators: { imageUrl: [{
186
- type: Input
187
- }], light: [{
188
- type: Input
189
- }], dark: [{
190
- type: Input
191
- }] } });
192
-
193
- class ColorConversionService {
194
- constructor() {
195
- this.componentToHex = (c) => {
196
- const hex = c.toString(16);
197
- return hex.length === 1 ? "0" + hex : hex;
198
- };
199
- }
200
- rgbToHex(rgb) {
201
- if (rgb === null || rgb.length !== 3 || rgb.some(value => value < 0 || value > 255))
202
- return '';
203
- const [r, g, b] = rgb;
204
- const hexR = this.componentToHex(r);
205
- const hexG = this.componentToHex(g);
206
- const hexB = this.componentToHex(b);
207
- return "#" + hexR + hexG + hexB;
208
- }
209
- hexToRgb(hex) {
210
- if (hex === null || hex === undefined)
211
- return [];
212
- hex = (hex.length === 3) ? hex + hex : hex;
213
- const result = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i.exec(hex);
214
- return result ? [
215
- parseInt(result[1], 16),
216
- parseInt(result[2], 16),
217
- parseInt(result[3], 16)
218
- ] : [];
219
- }
220
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorConversionService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
221
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorConversionService, providedIn: 'root' }); }
222
- }
223
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorConversionService, decorators: [{
224
- type: Injectable,
225
- args: [{
226
- providedIn: 'root'
227
- }]
228
- }] });
229
-
230
- class ColorPalletteService {
231
- constructor(colorConversionService) {
232
- this.colorConversionService = colorConversionService;
233
- // define image path
234
- // this.colorSelectionService.getColorsFromImage('../assets/sample2.jpg')
235
- // get colors
236
- // this.colorSelectionService.palette.subscribe(data => this.palette = data)
237
- // sample html
238
- // <div *ngFor="let color of palette">
239
- // <div style="display: flex;">
240
- // <div
241
- // class="box"
242
- // [style.background-color]="color.color"
243
- // >
244
- // Color
245
- // </div>
246
- // <div
247
- // class="box"
248
- // [style.background-color]="color.complementaryColor"
249
- // >
250
- // Complementary
251
- // </div>
252
- // </div>
253
- // </div>
254
- // CSS
255
- // .box {
256
- // width: 100px;
257
- // height: 100px;
258
- // border: solid thin black;
259
- // color: black;
260
- // margin: 4px;
261
- // padding: 16px;
262
- // display: flex;
263
- // flex-wrap: wrap;
264
- // align-content: center;
265
- // justify-content: center;
266
- // }
267
- this.palette = new BehaviorSubject([]);
268
- this.palette$ = this.palette.asObservable();
269
- }
270
- /**
271
- * Retrieves a color palette from an image at the specified path.
272
- *
273
- * @param imagePath - The path to the image to extract the color palette from.
274
- * @param colors - The number of colors to include in the palette (default is 3).
275
- * @returns An observable that emits the generated color palette.
276
- */
277
- getColorsFromImage(imagePath, colors = 3) {
278
- const image = new Image();
279
- image.src = imagePath;
280
- image.onload = () => {
281
- const data = this.generateColorPalette(image, colors) || [];
282
- this.palette.next(data);
283
- };
284
- }
285
- /**
286
- * Generates a color palette from an image.
287
- *
288
- * @param image - The HTML image element to extract the color palette from.
289
- * @param colorCount - The number of colors to include in the palette (default is 6).
290
- * @returns An array of color objects, each with a hex color and a complementary hex color.
291
- */
292
- generateColorPalette(image, colorCount = 6) {
293
- const canvas = document.createElement("canvas");
294
- const context = canvas.getContext("2d");
295
- if (!context)
296
- return;
297
- canvas.width = image.width;
298
- canvas.height = image.height;
299
- context.drawImage(image, 0, 0);
300
- // Get the image data
301
- const imageData = context.getImageData(0, 0, canvas.width, canvas.height);
302
- const pixels = imageData.data;
303
- const pixelCount = imageData.width * imageData.height;
304
- // Build an array of RGB colors
305
- const colors = [];
306
- for (let i = 0; i < pixelCount; i++) {
307
- const offset = i * 4;
308
- const r = pixels[offset];
309
- const g = pixels[offset + 1];
310
- const b = pixels[offset + 2];
311
- colors.push([r, g, b]);
312
- }
313
- // Apply color quantization using k-means clustering
314
- const quantizedColors = this.kMeansColorQuantization(colors, colorCount);
315
- // Order colors by luminance
316
- quantizedColors.sort((color1, color2) => {
317
- const luminance1 = this.getLuminance(color1);
318
- const luminance2 = this.getLuminance(color2);
319
- return luminance2 - luminance1;
320
- });
321
- const palette = quantizedColors.map((color) => {
322
- const complementaryColor = color.map((component) => 255 - component);
323
- const hexColor = this.colorConversionService.rgbToHex(color);
324
- const hexComplementaryColor = this.colorConversionService.rgbToHex(complementaryColor);
325
- return { color: hexColor, complementaryColor: hexComplementaryColor };
326
- });
327
- return palette;
328
- }
329
- getLuminance(color) {
330
- const [r, g, b] = color;
331
- return 0.299 * r + 0.587 * g + 0.114 * b;
332
- }
333
- calculateColorDistance(color1, color2) {
334
- const [r1, g1, b1] = color1;
335
- const [r2, g2, b2] = color2;
336
- const dr = r2 - r1;
337
- const dg = g2 - g1;
338
- const db = b2 - b1;
339
- return Math.sqrt(dr * dr + dg * dg + db * db);
340
- }
341
- calculateMeanColor(colors) {
342
- let sumR = 0;
343
- let sumG = 0;
344
- let sumB = 0;
345
- for (let i = 0; i < colors.length; i++) {
346
- const [r, g, b] = colors[i];
347
- sumR += r;
348
- sumG += g;
349
- sumB += b;
350
- }
351
- const meanR = Math.round(sumR / colors.length);
352
- const meanG = Math.round(sumG / colors.length);
353
- const meanB = Math.round(sumB / colors.length);
354
- return [meanR, meanG, meanB];
355
- }
356
- kMeansColorQuantization(colors, k) {
357
- let clusterCenters = [];
358
- for (let i = 0; i < k; i++) {
359
- const randomColor = colors[Math.floor(Math.random() * colors.length)];
360
- clusterCenters.push(randomColor);
361
- }
362
- let clusters = [];
363
- for (let i = 0; i < colors.length; i++) {
364
- const color = colors[i];
365
- let minDistance = Infinity;
366
- let nearestCenter = null;
367
- for (let j = 0; j < clusterCenters.length; j++) {
368
- const center = clusterCenters[j];
369
- const distance = this.calculateColorDistance(color, center);
370
- if (distance < minDistance) {
371
- minDistance = distance;
372
- nearestCenter = center;
373
- }
374
- }
375
- clusters.push({ color, center: nearestCenter });
376
- }
377
- let updatedCenters = [];
378
- for (let i = 0; i < clusterCenters.length; i++) {
379
- const center = clusterCenters[i];
380
- const clusterColors = clusters.filter(c => c.center === center).map(c => c.color);
381
- if (clusterColors.length > 0) {
382
- const updatedCenter = this.calculateMeanColor(clusterColors);
383
- updatedCenters.push(updatedCenter);
384
- }
385
- }
386
- return updatedCenters;
387
- }
388
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorPalletteService, deps: [{ token: ColorConversionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
389
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorPalletteService, providedIn: 'root' }); }
390
- }
391
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorPalletteService, decorators: [{
392
- type: Injectable,
393
- args: [{
394
- providedIn: 'root'
395
- }]
396
- }], ctorParameters: function () { return [{ type: ColorConversionService }]; } });
397
-
398
- class TextColorService {
399
- constructor(colorConversionService) {
400
- this.colorConversionService = colorConversionService;
401
- }
402
- textColorForBgColor(bgColor, lightColor, darkColor) {
403
- const UIColors = this.fixColor(bgColor);
404
- const r = UIColors[0];
405
- const g = UIColors[1];
406
- const b = UIColors[2];
407
- return ((r * 0.299 + g * 0.587 + b * 0.114) > 149) ? darkColor : lightColor;
408
- }
409
- darkerColor(color1, color2) {
410
- return this.isColorDarker(color1, color2) ? color1 : color2;
411
- }
412
- isColorDarker(color1, color2) {
413
- const newColor1 = this.fixColor(color1);
414
- const newColor2 = this.fixColor(color2);
415
- const luminance1 = this.calculateLuminance(newColor1[0], newColor1[1], newColor1[2]);
416
- const luminance2 = this.calculateLuminance(newColor2[0], newColor2[1], newColor2[2]);
417
- return luminance1 < luminance2;
418
- }
419
- lighterColor(color1, color2) {
420
- return (this.isColorLighter(color1, color2)) ? color1 : color2;
421
- }
422
- isColorLighter(color1, color2) {
423
- const newColor1 = this.fixColor(color1);
424
- const newColor2 = this.fixColor(color2);
425
- const luminance1 = this.calculateLuminance(newColor1[0], newColor1[1], newColor1[2]);
426
- const luminance2 = this.calculateLuminance(newColor2[0], newColor2[1], newColor2[2]);
427
- return (luminance1 > luminance2);
428
- }
429
- calculateLuminance(r, g, b) {
430
- return 0.2126 * r + 0.7152 * g + 0.0722 * b;
431
- }
432
- fixColor(color) {
433
- // Remove leading hash if present
434
- const sanitizedColor = color.startsWith('#') ? color.slice(1) : color;
435
- // Validate if the color is a valid hex (3 or 6 characters)
436
- if (!this.isValidHex(sanitizedColor)) {
437
- return this.parseRgb(sanitizedColor); // If not hex, attempt to parse as RGB
438
- }
439
- // Convert hex to RGB
440
- const rgb = this.hexToRgb(sanitizedColor);
441
- return rgb;
442
- }
443
- // Helper function to validate if a string is a valid 3 or 6 digit hex code
444
- isValidHex(color) {
445
- const hexRegex = /^[A-Fa-f0-9]{3}$|^[A-Fa-f0-9]{6}$/i;
446
- return hexRegex.test(color);
447
- }
448
- // Helper function to convert a 3 or 6 digit hex color to RGB
449
- hexToRgb(hex) {
450
- if (hex.length === 3) {
451
- hex = hex.split('').map(c => c + c).join(''); // Expand shorthand hex to full
452
- }
453
- return [
454
- parseInt(hex.slice(0, 2), 16),
455
- parseInt(hex.slice(2, 4), 16),
456
- parseInt(hex.slice(4, 6), 16),
457
- ];
458
- }
459
- // Helper function to parse an RGB string (e.g., rgb(255, 0, 0)) into an array
460
- parseRgb(rgb) {
461
- const match = rgb.match(/\d+/g);
462
- return match ? match.map(num => parseInt(num)) : [];
463
- }
464
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextColorService, deps: [{ token: ColorConversionService }], target: i0.ɵɵFactoryTarget.Injectable }); }
465
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextColorService, providedIn: 'root' }); }
466
- }
467
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: TextColorService, decorators: [{
468
- type: Injectable,
469
- args: [{
470
- providedIn: 'root'
471
- }]
472
- }], ctorParameters: function () { return [{ type: ColorConversionService }]; } });
473
-
474
- class ColorLightenDarkenService {
475
- // const color = '#3498db'; // Your color
476
- // const lighterColor = lighten(color, 0.2); // 20% lighter
477
- // const darkerColor = darken(color, 0.2); // 20% darker
478
- // console.log(lighterColor, darkerColor);
479
- constructor() {
480
- this.colors = inject(TextColorService);
481
- }
482
- lighten(color, amount) {
483
- const rgb = this.colors.fixColor(color);
484
- // const rgb = color.match(/\w\w/g)?.map((x) => parseInt(x, 16)) || [];
485
- // Convert RGB to HSL
486
- let [r, g, b] = rgb.map((c) => c / 255);
487
- const max = Math.max(r, g, b), min = Math.min(r, g, b);
488
- let h = 0, s = 0, l = (max + min) / 2;
489
- if (max !== min) {
490
- const d = max - min;
491
- s = l > 0.5 ? d / (2 - max - min) : d / (max + min);
492
- switch (max) {
493
- case r:
494
- h = (g - b) / d + (g < b ? 6 : 0);
495
- break;
496
- case g:
497
- h = (b - r) / d + 2;
498
- break;
499
- case b:
500
- h = (r - g) / d + 4;
501
- break;
502
- }
503
- h /= 6;
504
- }
505
- // Modify the lightness and clamp it to [0, 1]
506
- l = Math.min(1, l + amount);
507
- // Convert HSL back to RGB
508
- if (s === 0) {
509
- r = g = b = l; // achromatic
510
- }
511
- else {
512
- const hue2rgb = (p, q, t) => {
513
- if (t < 0)
514
- t += 1;
515
- if (t > 1)
516
- t -= 1;
517
- if (t < 1 / 6)
518
- return p + (q - p) * 6 * t;
519
- if (t < 1 / 2)
520
- return q;
521
- if (t < 2 / 3)
522
- return p + (q - p) * (2 / 3 - t) * 6;
523
- return p;
524
- };
525
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
526
- const p = 2 * l - q;
527
- r = hue2rgb(p, q, h + 1 / 3);
528
- g = hue2rgb(p, q, h);
529
- b = hue2rgb(p, q, h - 1 / 3);
530
- }
531
- // Convert RGB back to hexadecimal color
532
- const toHex = (x) => Math.round(x * 255)
533
- .toString(16)
534
- .padStart(2, '0');
535
- return `#${toHex(r)}${toHex(g)}${toHex(b)}`;
536
- }
537
- darken(color, amount) {
538
- return this.lighten(color, -amount);
539
- }
540
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorLightenDarkenService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
541
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorLightenDarkenService, providedIn: 'root' }); }
542
- }
543
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorLightenDarkenService, decorators: [{
544
- type: Injectable,
545
- args: [{
546
- providedIn: 'root'
547
- }]
548
- }], ctorParameters: function () { return []; } });
549
-
550
- class ColorSchemeService {
551
- constructor() { }
552
- /**
553
- * Generates a random hexadecimal color code.
554
- *
555
- * This function generates a random hue value between 0 and 360 degrees, and random saturation and lightness values between 50% and 100%. It then converts the HSL values to RGB values using the `hslToRgb` function, and finally converts the RGB values to a hexadecimal color code using the `rgbToHex` function.
556
- *
557
- * @returns A hexadecimal color code in the format "#RRGGBB".
558
- */
559
- generateRandomColor() {
560
- // Generate a random hue between 0 and 360 (representing degrees on the color wheel)
561
- const hue = Math.floor(Math.random() * 360);
562
- // Generate random saturation and lightness values between 50% and 100%
563
- const saturation = Math.floor(Math.random() * 51) + 50;
564
- const lightness = Math.floor(Math.random() * 51) + 50;
565
- // Convert HSL values to RGB values
566
- const rgbColor = this.hslToRgb(hue, saturation, lightness);
567
- // Convert RGB values to hexadecimal color code
568
- const hexColor = this.rgbToHex(rgbColor.r, rgbColor.g, rgbColor.b);
569
- return hexColor;
570
- }
571
- /**
572
- * Converts HSL (Hue, Saturation, Lightness) color values to RGB (Red, Green, Blue) color values.
573
- *
574
- * @param h - The hue value, ranging from 0 to 360 degrees.
575
- * @param s - The saturation value, ranging from 0 to 100 percent.
576
- * @param l - The lightness value, ranging from 0 to 100 percent.
577
- * @returns An object with the RGB color values, where each value is between 0 and 255.
578
- */
579
- hslToRgb(h, s, l) {
580
- h /= 360;
581
- s /= 100;
582
- l /= 100;
583
- let r, g, b;
584
- if (s === 0) {
585
- r = g = b = l; // Achromatic color (gray)
586
- }
587
- else {
588
- const hueToRgb = (p, q, t) => {
589
- if (t < 0)
590
- t += 1;
591
- if (t > 1)
592
- t -= 1;
593
- if (t < 1 / 6)
594
- return p + (q - p) * 6 * t;
595
- if (t < 1 / 2)
596
- return q;
597
- if (t < 2 / 3)
598
- return p + (q - p) * (2 / 3 - t) * 6;
599
- return p;
600
- };
601
- const q = l < 0.5 ? l * (1 + s) : l + s - l * s;
602
- const p = 2 * l - q;
603
- r = Math.round(hueToRgb(p, q, h + 1 / 3) * 255);
604
- g = Math.round(hueToRgb(p, q, h) * 255);
605
- b = Math.round(hueToRgb(p, q, h - 1 / 3) * 255);
606
- }
607
- return { r, g, b };
608
- }
609
- /**
610
- * Converts RGB color values to a hexadecimal color string.
611
- *
612
- * @param r - The red color value, between 0 and 255.
613
- * @param g - The green color value, between 0 and 255.
614
- * @param b - The blue color value, between 0 and 255.
615
- * @returns A hexadecimal color string in the format "#RRGGBB".
616
- */
617
- rgbToHex(r, g, b) {
618
- const componentToHex = (c) => {
619
- const hex = c.toString(16);
620
- return hex.length === 1 ? "0" + hex : hex;
621
- };
622
- return "#" + componentToHex(r) + componentToHex(g) + componentToHex(b);
623
- }
624
- /**
625
- * Adjusts a hexadecimal color value by a given percentage.
626
- *
627
- * @param hexColor - The hexadecimal color value to adjust.
628
- * @param percentage - The percentage to adjust the color by, ranging from -100 to 100.
629
- * @returns The adjusted hexadecimal color value.
630
- */
631
- adjustHexColor(hexColor, percentage) {
632
- // Remove the "#" symbol if present
633
- hexColor = hexColor.replace("#", "");
634
- // Convert the hex color to RGB values
635
- const red = parseInt(hexColor.substring(0, 2), 16);
636
- const green = parseInt(hexColor.substring(2, 4), 16);
637
- const blue = parseInt(hexColor.substring(4, 6), 16);
638
- // Calculate the adjustment amount based on the percentage
639
- const adjustAmount = Math.round(255 * (percentage / 100));
640
- // Adjust the RGB values
641
- const adjustedRed = this.clamp(red + adjustAmount);
642
- const adjustedGreen = this.clamp(green + adjustAmount);
643
- const adjustedBlue = this.clamp(blue + adjustAmount);
644
- // Convert the adjusted RGB values back to hex
645
- const adjustedHexColor = `#${(adjustedRed).toString(16).padStart(2, '0')}${(adjustedGreen).toString(16).padStart(2, '0')}${(adjustedBlue).toString(16).padStart(2, '0')}`;
646
- return adjustedHexColor;
647
- }
648
- clamp(value) {
649
- return Math.max(0, Math.min(value, 255));
650
- }
651
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorSchemeService, deps: [], target: i0.ɵɵFactoryTarget.Injectable }); }
652
- static { this.ɵprov = i0.ɵɵngDeclareInjectable({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorSchemeService, providedIn: 'root' }); }
653
- }
654
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorSchemeService, decorators: [{
655
- type: Injectable,
656
- args: [{
657
- providedIn: 'root'
658
- }]
659
- }], ctorParameters: function () { return []; } });
660
-
661
- class ColorUtilitiesDemoComponent {
662
- constructor() {
663
- this.colorConversionService = inject(ColorConversionService);
664
- this.colorLightenDarkenService = inject(ColorLightenDarkenService);
665
- this.colorPalletteService = inject(ColorPalletteService);
666
- this.textColorService = inject(TextColorService);
667
- this.colorSchemeService = inject(ColorSchemeService);
668
- this.HEX = this.colorConversionService.rgbToHex([12, 56, 128]);
669
- this.RGB = `rgb(${this.colorConversionService.hexToRgb('#AA11BB')})`;
670
- this.lighten = this.colorLightenDarkenService.lighten('#AA11BB', .25);
671
- this.darken = this.colorLightenDarkenService.darken('#AA11BB', .25);
672
- this.colorIsDarker = this.textColorService.isColorDarker(this.lighten, this.darken);
673
- this.darkBk = this.textColorService.textColorForBgColor(this.HEX, this.lighten, this.darken);
674
- this.lightBk = this.textColorService.textColorForBgColor('whitesmoke', this.lighten, this.darken);
675
- this.colors$ = this.colorPalletteService.palette$;
676
- this.colorPick = this.colorSchemeService.generateRandomColor();
677
- this.colorPickDarker = this.colorSchemeService.adjustHexColor(this.colorPick, -25);
678
- this.colorPickLighter = this.colorSchemeService.adjustHexColor(this.colorPick, 25);
679
- }
680
- ngOnInit() {
681
- // define image path
682
- this.img = '/assets/images/HD.png';
683
- this.colorPalletteService.getColorsFromImage(this.img, 8);
684
- }
685
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesDemoComponent, deps: [], target: i0.ɵɵFactoryTarget.Component }); }
686
- static { this.ɵcmp = i0.ɵɵngDeclareComponent({ minVersion: "14.0.0", version: "16.2.12", type: ColorUtilitiesDemoComponent, selector: "app-color-utilities-demo", ngImport: i0, template: "<div style=\"margin: 2rem;\">\n\n <h1>Color Conversion Service</h1>\n <div style=\"display: flex; flex-direction: column; gap: 1rem;\">\n <div style=\"display: flex\">\n <div style=\"padding-top: .5rem; margin-right: .5rem;\">rgbToHex: {{ HEX }}</div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"HEX\"></div>\n </div>\n\n <div style=\"display: flex\">\n <div style=\"padding-top: .5rem; margin-right: .5rem;\"> hexToRgb: {{ RGB }} </div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"RGB\"></div>\n </div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Color Light/Darken Service</h1>\n\n <div style=\"display: flex; flex-direction: column; gap: 1rem;\">\n\n <div style=\"display: flex; gap: 1rem\">\n Original Color: #AA11BB<br>\n <div style=\"width: 32px; height: 32px; background-color: #AA11BB;\"></div>\n Lighten (25%): {{ lighten }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"lighten\"></div>\n Darken (25%): {{ darken }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"darken\"></div>\n </div>\n\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Text Color Utility Services</h1>\n\n <div style=\"display: flex; gap: 1rem; flex-direction: column;\">\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"darken\"></div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"lighten\"></div>\n is Darker : {{ colorIsDarker }}\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorIsDarker\"></div>\n </div>\n \n <div style=\"display: flex; gap: 1rem; flex-direction: column;\">\n \n <div>\n Use: {{ lightBk }} for '{{ HEX }}' background-color<br>\n <div style=\"padding: 1rem;\" [style.backgroundColor]=\"HEX\" [style.color]=\"darkBk\">\n Sample Text Color\n </div>\n </div>\n\n <div>\n Use: {{ lightBk }} for 'whitesmoke' background-color<br>\n <div style=\"padding: 1rem; background-color: whitesmoke;\" [style.color]=\"lightBk\">\n Sample Text Color\n </div>\n </div>\n </div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n \n <h1>Color Schema Services</h1>\n\n <div style=\"display: flex; gap: 1rem\">\n Pick Color: {{ colorPick }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPick\"></div>\n Lighter Version: {{ colorPickLighter }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPickLighter\"></div>\n DarkerVersion: {{ colorPickDarker }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPickDarker\"></div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Color Pallette Service</h1>\n Creates Pallette from Image\n <div style=\"display: flex; gap: 2rem;\">\n <div>\n <img [src]=\"img\" height=\"180\">\n </div>\n\n <div style=\"display: flex; gap: .5rem; width: 120px; border: 1px solid black; flex-wrap: wrap; padding: .5rem;\">\n <div>Color Pick</div>\n <ng-container *ngFor=\"let color of (colors$ | async)\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"color.color\"></div>\n </ng-container>\n </div>\n \n <div style=\"display: flex; gap: .5rem; width: 120px; border: 1px solid black; flex-wrap: wrap; padding: .5rem;\">\n <div>Complementary</div>\n <ng-container *ngFor=\"let color of (colors$ | async)\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"color.complementaryColor\"></div>\n </ng-container>\n </div>\n </div>\n\n</div>\n\n", styles: [".box{width:100px;height:100px;border:solid thin black;color:#000;margin:4px;padding:16px;display:flex;flex-wrap:wrap;align-content:center;justify-content:center}\n"], dependencies: [{ kind: "directive", type: i1.NgForOf, selector: "[ngFor][ngForOf]", inputs: ["ngForOf", "ngForTrackBy", "ngForTemplate"] }, { kind: "component", type: i2.MatDivider, selector: "mat-divider", inputs: ["vertical", "inset"] }, { kind: "pipe", type: i1.AsyncPipe, name: "async" }] }); }
687
- }
688
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesDemoComponent, decorators: [{
689
- type: Component,
690
- args: [{ selector: 'app-color-utilities-demo', template: "<div style=\"margin: 2rem;\">\n\n <h1>Color Conversion Service</h1>\n <div style=\"display: flex; flex-direction: column; gap: 1rem;\">\n <div style=\"display: flex\">\n <div style=\"padding-top: .5rem; margin-right: .5rem;\">rgbToHex: {{ HEX }}</div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"HEX\"></div>\n </div>\n\n <div style=\"display: flex\">\n <div style=\"padding-top: .5rem; margin-right: .5rem;\"> hexToRgb: {{ RGB }} </div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"RGB\"></div>\n </div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Color Light/Darken Service</h1>\n\n <div style=\"display: flex; flex-direction: column; gap: 1rem;\">\n\n <div style=\"display: flex; gap: 1rem\">\n Original Color: #AA11BB<br>\n <div style=\"width: 32px; height: 32px; background-color: #AA11BB;\"></div>\n Lighten (25%): {{ lighten }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"lighten\"></div>\n Darken (25%): {{ darken }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"darken\"></div>\n </div>\n\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Text Color Utility Services</h1>\n\n <div style=\"display: flex; gap: 1rem; flex-direction: column;\">\n <div style=\"display: flex; gap: 1rem\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"darken\"></div>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"lighten\"></div>\n is Darker : {{ colorIsDarker }}\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorIsDarker\"></div>\n </div>\n \n <div style=\"display: flex; gap: 1rem; flex-direction: column;\">\n \n <div>\n Use: {{ lightBk }} for '{{ HEX }}' background-color<br>\n <div style=\"padding: 1rem;\" [style.backgroundColor]=\"HEX\" [style.color]=\"darkBk\">\n Sample Text Color\n </div>\n </div>\n\n <div>\n Use: {{ lightBk }} for 'whitesmoke' background-color<br>\n <div style=\"padding: 1rem; background-color: whitesmoke;\" [style.color]=\"lightBk\">\n Sample Text Color\n </div>\n </div>\n </div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n \n <h1>Color Schema Services</h1>\n\n <div style=\"display: flex; gap: 1rem\">\n Pick Color: {{ colorPick }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPick\"></div>\n Lighter Version: {{ colorPickLighter }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPickLighter\"></div>\n DarkerVersion: {{ colorPickDarker }}<br>\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"colorPickDarker\"></div>\n </div>\n\n <div style=\"margin-top: 1rem; margin-bottom: 1rem;\">\n <mat-divider></mat-divider>\n </div>\n\n <h1>Color Pallette Service</h1>\n Creates Pallette from Image\n <div style=\"display: flex; gap: 2rem;\">\n <div>\n <img [src]=\"img\" height=\"180\">\n </div>\n\n <div style=\"display: flex; gap: .5rem; width: 120px; border: 1px solid black; flex-wrap: wrap; padding: .5rem;\">\n <div>Color Pick</div>\n <ng-container *ngFor=\"let color of (colors$ | async)\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"color.color\"></div>\n </ng-container>\n </div>\n \n <div style=\"display: flex; gap: .5rem; width: 120px; border: 1px solid black; flex-wrap: wrap; padding: .5rem;\">\n <div>Complementary</div>\n <ng-container *ngFor=\"let color of (colors$ | async)\">\n <div style=\"width: 32px; height: 32px;\" [style.backgroundColor]=\"color.complementaryColor\"></div>\n </ng-container>\n </div>\n </div>\n\n</div>\n\n", styles: [".box{width:100px;height:100px;border:solid thin black;color:#000;margin:4px;padding:16px;display:flex;flex-wrap:wrap;align-content:center;justify-content:center}\n"] }]
691
- }], ctorParameters: function () { return []; } });
692
-
693
- class ColorExtractorDirective {
694
- constructor(elementRef, renderer) {
695
- this.elementRef = elementRef;
696
- this.renderer = renderer;
697
- this.colorValue = new EventEmitter();
698
- }
699
- get currentElement() {
700
- return window.getComputedStyle(this.elementRef.nativeElement);
701
- }
702
- onMouseEnter() {
703
- // console.log('ENTER', this.currentElement)
704
- this.colorValue.emit(this.currentElement.getPropertyValue('background-color'));
705
- }
706
- onMouseLeave() {
707
- // console.log('LEAVE', this.currentElement.getPropertyValue('background-color'))
708
- this.colorValue.emit('white');
709
- }
710
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorExtractorDirective, deps: [{ token: i0.ElementRef }, { token: i0.Renderer2 }], target: i0.ɵɵFactoryTarget.Directive }); }
711
- static { this.ɵdir = i0.ɵɵngDeclareDirective({ minVersion: "14.0.0", version: "16.2.12", type: ColorExtractorDirective, selector: "[getColor]", outputs: { colorValue: "colorValue" }, host: { listeners: { "mouseenter": "onMouseEnter()", "mouseleave": "onMouseLeave()" } }, ngImport: i0 }); }
712
- }
713
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorExtractorDirective, decorators: [{
714
- type: Directive,
715
- args: [{
716
- selector: '[getColor]'
717
- }]
718
- }], ctorParameters: function () { return [{ type: i0.ElementRef }, { type: i0.Renderer2 }]; }, propDecorators: { colorValue: [{
719
- type: Output
720
- }], onMouseEnter: [{
721
- type: HostListener,
722
- args: ['mouseenter']
723
- }], onMouseLeave: [{
724
- type: HostListener,
725
- args: ['mouseleave']
726
- }] } });
727
-
728
- class ColorUtilitiesModule {
729
- static { this.ɵfac = i0.ɵɵngDeclareFactory({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesModule, deps: [], target: i0.ɵɵFactoryTarget.NgModule }); }
730
- static { this.ɵmod = i0.ɵɵngDeclareNgModule({ minVersion: "14.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesModule, declarations: [ColorUtilitiesDemoComponent,
731
- ColorGrabberDirective,
732
- ColorExtractorDirective], imports: [CommonModule,
733
- MatButtonModule,
734
- MatDividerModule], exports: [ColorUtilitiesDemoComponent] }); }
735
- static { this.ɵinj = i0.ɵɵngDeclareInjector({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesModule, imports: [CommonModule,
736
- MatButtonModule,
737
- MatDividerModule] }); }
738
- }
739
- i0.ɵɵngDeclareClassMetadata({ minVersion: "12.0.0", version: "16.2.12", ngImport: i0, type: ColorUtilitiesModule, decorators: [{
740
- type: NgModule,
741
- args: [{
742
- imports: [
743
- CommonModule,
744
- MatButtonModule,
745
- MatDividerModule
746
- ],
747
- declarations: [
748
- ColorUtilitiesDemoComponent,
749
- ColorGrabberDirective,
750
- ColorExtractorDirective
751
- ],
752
- exports: [
753
- ColorUtilitiesDemoComponent
754
- ]
755
- }]
756
- }] });
757
-
758
- /*
759
- * Public API Surface of color-utils
760
- */
761
-
762
- /**
763
- * Generated bundle index. Do not edit.
764
- */
765
-
766
- export { ColorConversionService, ColorExtractorDirective, ColorGrabberDirective, ColorLightenDarkenService, ColorPalletteService, ColorSchemeService, ColorUtilitiesDemoComponent, ColorUtilitiesModule, TextColorService };
767
- //# sourceMappingURL=color-util-helpers.mjs.map