@voryx/color 1.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 (49) hide show
  1. package/dist/Color.d.ts +47 -0
  2. package/dist/Color.d.ts.map +1 -0
  3. package/dist/Color.js +551 -0
  4. package/dist/encode.d.ts +9 -0
  5. package/dist/encode.d.ts.map +1 -0
  6. package/dist/encode.js +60 -0
  7. package/dist/gamut/inGamut.d.ts +6 -0
  8. package/dist/gamut/inGamut.d.ts.map +1 -0
  9. package/dist/gamut/inGamut.js +25 -0
  10. package/dist/gamut/map.d.ts +8 -0
  11. package/dist/gamut/map.d.ts.map +1 -0
  12. package/dist/gamut/map.js +70 -0
  13. package/dist/gamut/types.d.ts +2 -0
  14. package/dist/gamut/types.d.ts.map +1 -0
  15. package/dist/gamut/types.js +0 -0
  16. package/dist/index.d.ts +10 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +1 -0
  19. package/dist/misc.d.ts +24 -0
  20. package/dist/misc.d.ts.map +1 -0
  21. package/dist/misc.js +38 -0
  22. package/dist/spaces/HSL.d.ts +9 -0
  23. package/dist/spaces/HSL.d.ts.map +1 -0
  24. package/dist/spaces/HSL.js +69 -0
  25. package/dist/spaces/LMS.d.ts +7 -0
  26. package/dist/spaces/LMS.d.ts.map +1 -0
  27. package/dist/spaces/LMS.js +0 -0
  28. package/dist/spaces/OKLAB.d.ts +9 -0
  29. package/dist/spaces/OKLAB.d.ts.map +1 -0
  30. package/dist/spaces/OKLAB.js +62 -0
  31. package/dist/spaces/OKLCH.d.ts +9 -0
  32. package/dist/spaces/OKLCH.d.ts.map +1 -0
  33. package/dist/spaces/OKLCH.js +35 -0
  34. package/dist/spaces/P3.d.ts +12 -0
  35. package/dist/spaces/P3.d.ts.map +1 -0
  36. package/dist/spaces/P3.js +58 -0
  37. package/dist/spaces/RGB.d.ts +9 -0
  38. package/dist/spaces/RGB.d.ts.map +1 -0
  39. package/dist/spaces/RGB.js +21 -0
  40. package/dist/spaces/SRGB.d.ts +11 -0
  41. package/dist/spaces/SRGB.d.ts.map +1 -0
  42. package/dist/spaces/SRGB.js +63 -0
  43. package/dist/spaces/types.d.ts +6 -0
  44. package/dist/spaces/types.d.ts.map +1 -0
  45. package/dist/spaces/types.js +0 -0
  46. package/dist/transforms.d.ts +13 -0
  47. package/dist/transforms.d.ts.map +1 -0
  48. package/dist/transforms.js +25 -0
  49. package/package.json +36 -0
@@ -0,0 +1,25 @@
1
+ class TransformFn {
2
+ static op(_x) {
3
+ throw new Error('Not implemented');
4
+ }
5
+ static inverse(_x) {
6
+ throw new Error('Not implemented');
7
+ }
8
+ }
9
+ class GammaCorrection extends TransformFn {
10
+ static op(x) {
11
+ return x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055;
12
+ }
13
+ static inverse(x) {
14
+ return x <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);
15
+ }
16
+ }
17
+ class CubeRoot extends TransformFn {
18
+ static op(x) {
19
+ return Math.cbrt(x);
20
+ }
21
+ static inverse(x) {
22
+ return Math.pow(x, 3);
23
+ }
24
+ }
25
+ export { CubeRoot, GammaCorrection, TransformFn };
package/package.json ADDED
@@ -0,0 +1,36 @@
1
+ {
2
+ "name": "@voryx/color",
3
+ "version": "1.0.0",
4
+ "description": "A Voryx library for color utilities.",
5
+ "license": "MIT",
6
+ "type": "module",
7
+ "sideEffects": false,
8
+ "publishConfig": {
9
+ "access": "public"
10
+ },
11
+ "files": [
12
+ "dist"
13
+ ],
14
+ "main": "./dist/index.js",
15
+ "types": "./dist/index.d.ts",
16
+ "exports": {
17
+ ".": {
18
+ "import": "./dist/index.js",
19
+ "types": "./dist/index.d.ts"
20
+ }
21
+ },
22
+ "dependencies": {
23
+ "@voryx/object-cache": "1.0.0"
24
+ },
25
+ "devDependencies": {
26
+ "@types/node": "^25.2.3",
27
+ "ts-standard": "^12.0.2",
28
+ "typescript": "^5.9.3",
29
+ "@voryx/vc": "1.0.0",
30
+ "@voryx/tsconfig": "0.0.0"
31
+ },
32
+ "scripts": {
33
+ "build": "vc build",
34
+ "lint": "ts-standard"
35
+ }
36
+ }