chromonym 1.4.1 → 3.0.0

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 (114) hide show
  1. package/NOTICE.md +64 -4
  2. package/README.md +290 -83
  3. package/dist/conversions/hex.d.ts +1 -1
  4. package/dist/conversions/hex.d.ts.map +1 -1
  5. package/dist/conversions/hex.js +2 -2
  6. package/dist/conversions/hex.js.map +1 -1
  7. package/dist/conversions/hsl.d.ts +1 -1
  8. package/dist/conversions/hsl.d.ts.map +1 -1
  9. package/dist/conversions/hsl.js +2 -2
  10. package/dist/conversions/hsl.js.map +1 -1
  11. package/dist/conversions/hsv.d.ts +1 -1
  12. package/dist/conversions/hsv.d.ts.map +1 -1
  13. package/dist/conversions/hsv.js +2 -2
  14. package/dist/conversions/hsv.js.map +1 -1
  15. package/dist/conversions/index.d.ts +5 -5
  16. package/dist/conversions/index.d.ts.map +1 -1
  17. package/dist/conversions/index.js +5 -5
  18. package/dist/conversions/index.js.map +1 -1
  19. package/dist/conversions/pantone.d.ts +9 -7
  20. package/dist/conversions/pantone.d.ts.map +1 -1
  21. package/dist/conversions/pantone.js +11 -10
  22. package/dist/conversions/pantone.js.map +1 -1
  23. package/dist/conversions/rgb.d.ts +1 -1
  24. package/dist/conversions/rgb.d.ts.map +1 -1
  25. package/dist/conversions/rgb.js +1 -1
  26. package/dist/conversions/rgb.js.map +1 -1
  27. package/dist/convert.d.ts +45 -5
  28. package/dist/convert.d.ts.map +1 -1
  29. package/dist/convert.js +68 -17
  30. package/dist/convert.js.map +1 -1
  31. package/dist/detectFormat.d.ts +1 -1
  32. package/dist/detectFormat.d.ts.map +1 -1
  33. package/dist/detectFormat.js +2 -6
  34. package/dist/detectFormat.js.map +1 -1
  35. package/dist/identify.d.ts +41 -19
  36. package/dist/identify.d.ts.map +1 -1
  37. package/dist/identify.js +37 -22
  38. package/dist/identify.js.map +1 -1
  39. package/dist/index.d.ts +15 -14
  40. package/dist/index.d.ts.map +1 -1
  41. package/dist/index.js +14 -13
  42. package/dist/index.js.map +1 -1
  43. package/dist/indexing.d.ts +48 -24
  44. package/dist/indexing.d.ts.map +1 -1
  45. package/dist/indexing.js +111 -22
  46. package/dist/indexing.js.map +1 -1
  47. package/dist/math/clamp.d.ts.map +1 -1
  48. package/dist/math/clamp.js.map +1 -1
  49. package/dist/math/colorSpace.d.ts +1 -1
  50. package/dist/math/colorSpace.d.ts.map +1 -1
  51. package/dist/math/colorSpace.js.map +1 -1
  52. package/dist/math/deltaE.d.ts.map +1 -1
  53. package/dist/math/deltaE.js.map +1 -1
  54. package/dist/math/editDistance.d.ts +17 -0
  55. package/dist/math/editDistance.d.ts.map +1 -0
  56. package/dist/math/editDistance.js +48 -0
  57. package/dist/math/editDistance.js.map +1 -0
  58. package/dist/math/euclideanDistance.d.ts +1 -1
  59. package/dist/math/euclideanDistance.d.ts.map +1 -1
  60. package/dist/math/euclideanDistance.js.map +1 -1
  61. package/dist/math/hueSector.d.ts.map +1 -1
  62. package/dist/math/hueSector.js.map +1 -1
  63. package/dist/palettes/crayola.d.ts +200 -0
  64. package/dist/palettes/crayola.d.ts.map +1 -0
  65. package/dist/palettes/crayola.js +121 -0
  66. package/dist/palettes/crayola.js.map +1 -0
  67. package/dist/palettes/index.d.ts +5 -0
  68. package/dist/palettes/index.d.ts.map +1 -0
  69. package/dist/palettes/index.js +5 -0
  70. package/dist/palettes/index.js.map +1 -0
  71. package/dist/palettes/normalize.d.ts +17 -0
  72. package/dist/palettes/normalize.d.ts.map +1 -0
  73. package/dist/palettes/normalize.js +19 -0
  74. package/dist/palettes/normalize.js.map +1 -0
  75. package/dist/palettes/pantone.d.ts +1834 -0
  76. package/dist/palettes/pantone.d.ts.map +1 -0
  77. package/dist/palettes/pantone.js +925 -0
  78. package/dist/palettes/pantone.js.map +1 -0
  79. package/dist/palettes/web.d.ts +320 -0
  80. package/dist/palettes/web.d.ts.map +1 -0
  81. package/dist/{colorspaces → palettes}/web.js +18 -3
  82. package/dist/palettes/web.js.map +1 -0
  83. package/dist/palettes/x11.d.ts +1346 -0
  84. package/dist/palettes/x11.d.ts.map +1 -0
  85. package/dist/palettes/x11.js +686 -0
  86. package/dist/palettes/x11.js.map +1 -0
  87. package/dist/resolve.d.ts +42 -7
  88. package/dist/resolve.d.ts.map +1 -1
  89. package/dist/resolve.js +48 -20
  90. package/dist/resolve.js.map +1 -1
  91. package/dist/types.d.ts +10 -6
  92. package/dist/types.d.ts.map +1 -1
  93. package/dist/types.js +2 -1
  94. package/dist/types.js.map +1 -1
  95. package/package.json +38 -18
  96. package/dist/colorspaces/index.d.ts +0 -4
  97. package/dist/colorspaces/index.d.ts.map +0 -1
  98. package/dist/colorspaces/index.js +0 -4
  99. package/dist/colorspaces/index.js.map +0 -1
  100. package/dist/colorspaces/pantone.d.ts +0 -919
  101. package/dist/colorspaces/pantone.d.ts.map +0 -1
  102. package/dist/colorspaces/pantone.js +0 -918
  103. package/dist/colorspaces/pantone.js.map +0 -1
  104. package/dist/colorspaces/registry.d.ts +0 -26
  105. package/dist/colorspaces/registry.d.ts.map +0 -1
  106. package/dist/colorspaces/registry.js +0 -36
  107. package/dist/colorspaces/registry.js.map +0 -1
  108. package/dist/colorspaces/web.d.ts +0 -156
  109. package/dist/colorspaces/web.d.ts.map +0 -1
  110. package/dist/colorspaces/web.js.map +0 -1
  111. package/dist/colorspaces/x11.d.ts +0 -667
  112. package/dist/colorspaces/x11.d.ts.map +0 -1
  113. package/dist/colorspaces/x11.js +0 -666
  114. package/dist/colorspaces/x11.js.map +0 -1
package/NOTICE.md CHANGED
@@ -6,7 +6,7 @@
6
6
  **not affiliated with, endorsed by, licensed by, or certified by Pantone
7
7
  LLC**.
8
8
 
9
- The `pantone` colorspace in this library ships **community-derived sRGB
9
+ The `pantone` palette in this library ships **community-derived sRGB
10
10
  approximations** of the Pantone Coated (C) color set, sourced from
11
11
  [`color_library`](https://github.com/draganradu/color_library) (MIT © Radu
12
12
  Dragan). These values:
@@ -16,21 +16,81 @@ Dragan). These values:
16
16
  exactly.
17
17
  - Are intended for on-screen reference, nearest-name identification, and
18
18
  general tooling — **not for print color specification**.
19
- - Use standard color codes (e.g. `185C`) as **nominative references** to
19
+ - Use standard color codes (e.g. `185 C`) as **nominative references** to
20
20
  publicly identified Pantone colors. No endorsement or claim of accuracy
21
21
  is implied.
22
22
 
23
+ ### Accuracy envelope
24
+
25
+ The approximations are closest for mid-chroma colors under a D65 / 2°
26
+ observer. As a rough guide:
27
+
28
+ - **Mid-chroma Pantones**: ΔE*00 ≲ 5 versus Pantone's own sRGB previews.
29
+ Usable for nearest-name identification and comparative swatch UI.
30
+ - **Saturated edges**: ΔE*00 commonly 5–10, higher in the deep-blue and
31
+ blue-violet region (~2736 C through ~2746 C). `identify` will still
32
+ converge on a plausible neighbor, but the *which* can depend on metric
33
+ choice — see the "Distance metrics" section of the README.
34
+ - **Fluorescents (801 C – 814 C)** and the **metallic series (8xxx C)**
35
+ are defined outside the sRGB gamut. Their sRGB approximations are
36
+ perceptually wrong by construction — the physical inks can't be
37
+ reproduced on a standard monitor. Do not use these values as a
38
+ reference for brand-critical matching; identify carefully or skip.
39
+ - **Neons / warm reds** clipping against the sRGB gamut boundary (Pantone
40
+ Red 032 / Warm Red / Red 021 area) are approximated via hard clip.
41
+
42
+ ### What `identify` does *not* guarantee
43
+
44
+ `identify(sampledRgba, { palette: pantone })` returns the nearest
45
+ entry **in the shipped sRGB approximation set**. It does **not** imply
46
+ that the physical ink bearing that Pantone code would match your sampled
47
+ color in a print workflow, under a different light source, or on
48
+ different paper stock. Pantone is a spectral specification; any
49
+ color-library lookup that rounds it through sRGB loses information.
50
+
23
51
  If you need Pantone-certified color values, consult Pantone directly:
24
52
  <https://www.pantone.com/>.
25
53
 
54
+ ## Crayola®
55
+
56
+ **Crayola®** is a registered trademark of **Crayola LLC**. Chromonym is
57
+ **not affiliated with, endorsed by, licensed by, or certified by Crayola
58
+ LLC**.
59
+
60
+ The `crayola` palette in this library ships a **community-curated
61
+ subset** of Crayola crayon-color names with sRGB approximations of their
62
+ wrappers. The names are used as **nominative references** to publicly
63
+ identified Crayola colors — there is no trademark claim, and no
64
+ endorsement is implied. Hex values are derived from the widely-cited
65
+ Wikipedia list of Crayola crayon colors (CC BY-SA), which itself cites
66
+ Crayola's published approximations.
67
+
68
+ ### Scope
69
+
70
+ The shipped set is ~85 entries — the current 64-standard box, the
71
+ iconic fluorescent "Neon" range, and widely-recognized modern
72
+ additions. It is not exhaustive: historical, retired, specialty-box
73
+ (Gem Tones, Heads 'N Tails, Multicultural, etc.), and regional-variant
74
+ colors are not included. If you need a specific Crayola color that
75
+ isn't present, open an issue or define a BYO palette.
76
+
77
+ ### Accuracy
78
+
79
+ - Fluorescents and neons saturate outside sRGB by design; on-screen
80
+ sRGB approximations are necessarily softer than the physical crayons.
81
+ - Metallics (Silver, Gold, Copper) are flat sRGB approximations; the
82
+ physical crayons' reflective behavior is lost.
83
+ - Classic hues are close enough for comparative UI / identification
84
+ work but should not be used as a reference for print color matching.
85
+
26
86
  ## X11 / X.Org
27
87
 
28
- The `x11` colorspace is derived from the X.Org `rgb.txt` file, which is in
88
+ The `x11` palette is derived from the X.Org `rgb.txt` file, which is in
29
89
  the public domain.
30
90
 
31
91
  ## CSS / SVG named colors
32
92
 
33
- The `web` colorspace mirrors the CSS Color Module Level 4 named-color
93
+ The `web` palette mirrors the CSS Color Module Level 4 named-color
34
94
  set, which is a public specification.
35
95
 
36
96
  ## Upstream dependencies