@kidthales/tol-palettes 0.0.0-stage → 0.2.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 (145) hide show
  1. package/LICENSE +36 -0
  2. package/NOTICE +58 -0
  3. package/README.md +182 -2
  4. package/data/schemes/banded-12.json +49 -0
  5. package/data/schemes/banded-16.json +61 -0
  6. package/data/schemes/banded-20.json +73 -0
  7. package/data/schemes/bright.json +48 -0
  8. package/data/schemes/burd.json +43 -0
  9. package/data/schemes/dark.json +45 -0
  10. package/data/schemes/groundcover.json +54 -0
  11. package/data/schemes/high-contrast.json +32 -0
  12. package/data/schemes/incandescent.json +46 -0
  13. package/data/schemes/iridescent.json +85 -0
  14. package/data/schemes/light.json +56 -0
  15. package/data/schemes/medium-contrast.json +44 -0
  16. package/data/schemes/muted.json +61 -0
  17. package/data/schemes/nightfall.json +78 -0
  18. package/data/schemes/pale.json +33 -0
  19. package/data/schemes/prgn.json +43 -0
  20. package/data/schemes/rainbow-discrete.json +430 -0
  21. package/data/schemes/rainbow-smooth.json +143 -0
  22. package/data/schemes/sunset.json +49 -0
  23. package/data/schemes/vibrant.json +48 -0
  24. package/data/schemes/whorbr.json +44 -0
  25. package/data/schemes/ylorbr.json +43 -0
  26. package/dist/aseprite/banded-12.gpl +21 -0
  27. package/dist/aseprite/banded-16.gpl +25 -0
  28. package/dist/aseprite/banded-20.gpl +29 -0
  29. package/dist/aseprite/bright.gpl +17 -0
  30. package/dist/aseprite/burd.gpl +18 -0
  31. package/dist/aseprite/dark.gpl +20 -0
  32. package/dist/aseprite/groundcover.gpl +23 -0
  33. package/dist/aseprite/high-contrast.gpl +13 -0
  34. package/dist/aseprite/incandescent.gpl +20 -0
  35. package/dist/aseprite/iridescent.gpl +32 -0
  36. package/dist/aseprite/light.gpl +19 -0
  37. package/dist/aseprite/medium-contrast.gpl +16 -0
  38. package/dist/aseprite/muted.gpl +20 -0
  39. package/dist/aseprite/nightfall.gpl +26 -0
  40. package/dist/aseprite/pale.gpl +16 -0
  41. package/dist/aseprite/prgn.gpl +18 -0
  42. package/dist/aseprite/rainbow-discrete.gpl +38 -0
  43. package/dist/aseprite/rainbow-smooth.gpl +43 -0
  44. package/dist/aseprite/sunset.gpl +20 -0
  45. package/dist/aseprite/vibrant.gpl +17 -0
  46. package/dist/aseprite/whorbr.gpl +18 -0
  47. package/dist/aseprite/ylorbr.gpl +18 -0
  48. package/dist/css/banded-12.css +23 -0
  49. package/dist/css/banded-16.css +27 -0
  50. package/dist/css/banded-20.css +31 -0
  51. package/dist/css/bright.css +25 -0
  52. package/dist/css/burd.css +21 -0
  53. package/dist/css/dark.css +21 -0
  54. package/dist/css/groundcover.css +24 -0
  55. package/dist/css/high-contrast.css +17 -0
  56. package/dist/css/incandescent.css +23 -0
  57. package/dist/css/iridescent.css +35 -0
  58. package/dist/css/light.css +29 -0
  59. package/dist/css/medium-contrast.css +23 -0
  60. package/dist/css/muted.css +31 -0
  61. package/dist/css/nightfall.css +38 -0
  62. package/dist/css/pale.css +17 -0
  63. package/dist/css/prgn.css +21 -0
  64. package/dist/css/rainbow-discrete.css +316 -0
  65. package/dist/css/rainbow-smooth.css +46 -0
  66. package/dist/css/sunset.css +23 -0
  67. package/dist/css/tol.css +732 -0
  68. package/dist/css/vibrant.css +25 -0
  69. package/dist/css/whorbr.css +21 -0
  70. package/dist/css/ylorbr.css +21 -0
  71. package/dist/godot/addons/tol_palettes/banded-12.tres +10 -0
  72. package/dist/godot/addons/tol_palettes/banded-16.tres +10 -0
  73. package/dist/godot/addons/tol_palettes/banded-20.tres +10 -0
  74. package/dist/godot/addons/tol_palettes/bright.tres +10 -0
  75. package/dist/godot/addons/tol_palettes/burd.tres +10 -0
  76. package/dist/godot/addons/tol_palettes/dark.tres +10 -0
  77. package/dist/godot/addons/tol_palettes/groundcover.tres +10 -0
  78. package/dist/godot/addons/tol_palettes/high-contrast.tres +10 -0
  79. package/dist/godot/addons/tol_palettes/incandescent.tres +10 -0
  80. package/dist/godot/addons/tol_palettes/iridescent.tres +10 -0
  81. package/dist/godot/addons/tol_palettes/light.tres +10 -0
  82. package/dist/godot/addons/tol_palettes/medium-contrast.tres +10 -0
  83. package/dist/godot/addons/tol_palettes/muted.tres +10 -0
  84. package/dist/godot/addons/tol_palettes/nightfall.tres +10 -0
  85. package/dist/godot/addons/tol_palettes/pale.tres +10 -0
  86. package/dist/godot/addons/tol_palettes/plugin.cfg +12 -0
  87. package/dist/godot/addons/tol_palettes/prgn.tres +10 -0
  88. package/dist/godot/addons/tol_palettes/rainbow-discrete.tres +10 -0
  89. package/dist/godot/addons/tol_palettes/rainbow-smooth.tres +10 -0
  90. package/dist/godot/addons/tol_palettes/sunset.tres +10 -0
  91. package/dist/godot/addons/tol_palettes/tol_palettes.gd +301 -0
  92. package/dist/godot/addons/tol_palettes/vibrant.tres +10 -0
  93. package/dist/godot/addons/tol_palettes/whorbr.tres +10 -0
  94. package/dist/godot/addons/tol_palettes/ylorbr.tres +10 -0
  95. package/dist/godot/banded-12.tres +10 -0
  96. package/dist/godot/banded-16.tres +10 -0
  97. package/dist/godot/banded-20.tres +10 -0
  98. package/dist/godot/bright.tres +10 -0
  99. package/dist/godot/burd.tres +10 -0
  100. package/dist/godot/dark.tres +10 -0
  101. package/dist/godot/groundcover.tres +10 -0
  102. package/dist/godot/high-contrast.tres +10 -0
  103. package/dist/godot/incandescent.tres +10 -0
  104. package/dist/godot/iridescent.tres +10 -0
  105. package/dist/godot/light.tres +10 -0
  106. package/dist/godot/medium-contrast.tres +10 -0
  107. package/dist/godot/muted.tres +10 -0
  108. package/dist/godot/nightfall.tres +10 -0
  109. package/dist/godot/pale.tres +10 -0
  110. package/dist/godot/prgn.tres +10 -0
  111. package/dist/godot/rainbow-discrete.tres +10 -0
  112. package/dist/godot/rainbow-smooth.tres +10 -0
  113. package/dist/godot/sunset.tres +10 -0
  114. package/dist/godot/tol_palettes.gd +301 -0
  115. package/dist/godot/vibrant.tres +10 -0
  116. package/dist/godot/whorbr.tres +10 -0
  117. package/dist/godot/ylorbr.tres +10 -0
  118. package/dist/gpl/banded-12.gpl +20 -0
  119. package/dist/gpl/banded-16.gpl +24 -0
  120. package/dist/gpl/banded-20.gpl +28 -0
  121. package/dist/gpl/bright.gpl +16 -0
  122. package/dist/gpl/burd.gpl +17 -0
  123. package/dist/gpl/dark.gpl +19 -0
  124. package/dist/gpl/groundcover.gpl +22 -0
  125. package/dist/gpl/high-contrast.gpl +12 -0
  126. package/dist/gpl/incandescent.gpl +19 -0
  127. package/dist/gpl/iridescent.gpl +31 -0
  128. package/dist/gpl/light.gpl +18 -0
  129. package/dist/gpl/medium-contrast.gpl +15 -0
  130. package/dist/gpl/muted.gpl +19 -0
  131. package/dist/gpl/nightfall.gpl +25 -0
  132. package/dist/gpl/pale.gpl +15 -0
  133. package/dist/gpl/prgn.gpl +17 -0
  134. package/dist/gpl/rainbow-discrete.gpl +37 -0
  135. package/dist/gpl/rainbow-smooth.gpl +42 -0
  136. package/dist/gpl/sunset.gpl +19 -0
  137. package/dist/gpl/vibrant.gpl +16 -0
  138. package/dist/gpl/whorbr.gpl +17 -0
  139. package/dist/gpl/ylorbr.gpl +17 -0
  140. package/dist/js/index.d.ts +92 -0
  141. package/dist/js/index.js +1845 -0
  142. package/dist/json/schemes.json +1613 -0
  143. package/dist/py/tol_palettes.py +1092 -0
  144. package/package.json +82 -4
  145. package/schema/scheme.schema.json +90 -0
package/package.json CHANGED
@@ -1,6 +1,84 @@
1
1
  {
2
2
  "name": "@kidthales/tol-palettes",
3
- "version": "0.0.0-stage",
4
- "stub": true,
5
- "description": "Temporary package placeholder for staged publishing"
6
- }
3
+ "version": "0.2.0",
4
+ "description": "Paul Tol colour scheme data (values only, with attribution) and generators for CSS, JS/TS, Python, Godot, and GPL/Aseprite.",
5
+ "publishConfig": {
6
+ "access": "public",
7
+ "registry": "https://registry.npmjs.org/"
8
+ },
9
+ "license": "BSD-3-Clause",
10
+ "author": "kidthales",
11
+ "type": "module",
12
+ "main": "./dist/js/index.js",
13
+ "types": "./dist/js/index.d.ts",
14
+ "repository": {
15
+ "type": "git",
16
+ "url": "git+https://github.com/kidthales/tol-palettes.git"
17
+ },
18
+ "homepage": "https://github.com/kidthales/tol-palettes#readme",
19
+ "bugs": {
20
+ "url": "https://github.com/kidthales/tol-palettes/issues"
21
+ },
22
+ "keywords": [
23
+ "paul-tol",
24
+ "color-schemes",
25
+ "colorblind-safe",
26
+ "palettes",
27
+ "dataviz",
28
+ "accessible",
29
+ "wcag",
30
+ "css",
31
+ "aseprite",
32
+ "godot",
33
+ "python"
34
+ ],
35
+ "files": [
36
+ "dist/css/",
37
+ "dist/js/",
38
+ "dist/json/",
39
+ "dist/py/tol_palettes.py",
40
+ "dist/godot/",
41
+ "dist/gpl/",
42
+ "dist/aseprite/",
43
+ "data/",
44
+ "schema/",
45
+ "NOTICE",
46
+ "LICENSE",
47
+ "README.md"
48
+ ],
49
+ "exports": {
50
+ ".": {
51
+ "types": "./dist/js/index.d.ts",
52
+ "default": "./dist/js/index.js"
53
+ },
54
+ "./schemes.json": "./dist/json/schemes.json",
55
+ "./css/*": "./dist/css/*",
56
+ "./js/*": "./dist/js/*",
57
+ "./py/*": "./dist/py/*",
58
+ "./godot/*": "./dist/godot/*",
59
+ "./gpl/*": "./dist/gpl/*",
60
+ "./aseprite/*": "./dist/aseprite/*",
61
+ "./package.json": "./package.json"
62
+ },
63
+ "sideEffects": false,
64
+ "engines": {
65
+ "node": ">=22"
66
+ },
67
+ "scripts": {
68
+ "lint": "node tools/lint.mjs",
69
+ "test": "npm run lint && node --test",
70
+ "validate": "node tools/validate.mjs",
71
+ "extract": "node tools/extract.mjs",
72
+ "generate:css": "node tools/generate-css.mjs",
73
+ "generate:js": "node tools/generate-js.mjs",
74
+ "generate:py": "node tools/generate-py.mjs",
75
+ "generate:game": "node tools/generate-game.mjs",
76
+ "package:assets": "node tools/package-assets.mjs",
77
+ "generate:gallery": "node tools/generate-gallery.mjs",
78
+ "generate": "npm run generate:css && npm run generate:js && npm run generate:py && npm run generate:game && npm run package:assets && npm run generate:gallery",
79
+ "ci:local": "pwsh -NoProfile -ExecutionPolicy Bypass ./scripts/ci-local.ps1"
80
+ },
81
+ "devDependencies": {
82
+ "ajv": "^8.17.1"
83
+ }
84
+ }
@@ -0,0 +1,90 @@
1
+ {
2
+ "$schema": "https://json-schema.org/draft/2020-12/schema",
3
+ "$id": "https://github.com/kidthales/tol-palettes/schema/scheme.schema.json",
4
+ "title": "tol-palettes scheme",
5
+ "description": "One colour scheme. Colour values only; a colour 'name' is present only when the official source (tol_colors.py) provides one.",
6
+ "type": "object",
7
+ "additionalProperties": false,
8
+ "required": ["id", "kind", "colors", "interpolation", "source"],
9
+ "properties": {
10
+ "id": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
11
+ "kind": { "enum": ["qualitative", "diverging", "sequential", "special"] },
12
+ "colors": {
13
+ "description": "Colours in the source's default order.",
14
+ "type": "array",
15
+ "minItems": 1,
16
+ "items": { "$ref": "#/$defs/color" }
17
+ },
18
+ "extras": {
19
+ "description": "Additional colours that exist only in tol_colors.py (for example black), kept apart from the notes page's list.",
20
+ "type": "array",
21
+ "minItems": 1,
22
+ "items": { "$ref": "#/$defs/color" }
23
+ },
24
+ "bad": { "$ref": "#/$defs/hex", "description": "Colour intended for missing/bad data, as given by the source." },
25
+ "interpolation": {
26
+ "description": "How the source says the colours may be used: none (discrete only), linear (intended to be interpolated) or either.",
27
+ "enum": ["none", "linear", "either"]
28
+ },
29
+ "discreteIndexes": {
30
+ "description": "Indexes into colors that form the discrete variant when it differs from using every colour.",
31
+ "type": "array",
32
+ "minItems": 1,
33
+ "items": { "type": "integer", "minimum": 0 }
34
+ },
35
+ "lut": {
36
+ "description": "Discrete rainbow only: lut[n-1] lists the indexes into colors used when n colours are requested.",
37
+ "type": "array",
38
+ "minItems": 1,
39
+ "items": { "type": "array", "minItems": 1, "items": { "type": "integer", "minimum": 0 } }
40
+ },
41
+ "lutBad": {
42
+ "description": "Discrete rainbow only: bad-data colour overrides keyed by requested length.",
43
+ "type": "object",
44
+ "additionalProperties": { "$ref": "#/$defs/hex" }
45
+ },
46
+ "subranges": {
47
+ "description": "Named sub-ranges of colors (inclusive indexes), with the bad-data colour that goes with each.",
48
+ "type": "array",
49
+ "minItems": 1,
50
+ "items": {
51
+ "type": "object",
52
+ "additionalProperties": false,
53
+ "required": ["id", "from", "to"],
54
+ "properties": {
55
+ "id": { "type": "string", "minLength": 1 },
56
+ "from": { "type": "integer", "minimum": 0 },
57
+ "to": { "type": "integer", "minimum": 0 },
58
+ "bad": { "$ref": "#/$defs/hex" }
59
+ }
60
+ }
61
+ },
62
+ "source": {
63
+ "type": "object",
64
+ "additionalProperties": false,
65
+ "required": ["retrieved"],
66
+ "anyOf": [{ "required": ["siteFigure"] }, { "required": ["module"] }],
67
+ "properties": {
68
+ "siteFigure": { "type": "string", "pattern": "^fig:" },
69
+ "siteUrl": { "type": "string", "format": "uri" },
70
+ "module": { "type": "string", "minLength": 1 },
71
+ "moduleName": { "type": "string", "minLength": 1 },
72
+ "moduleVersion": { "type": "string", "minLength": 1 },
73
+ "retrieved": { "type": "string", "pattern": "^\\d{4}-\\d{2}-\\d{2}$" },
74
+ "notes": { "type": "array", "items": { "type": "string", "minLength": 1 } }
75
+ }
76
+ }
77
+ },
78
+ "$defs": {
79
+ "hex": { "type": "string", "pattern": "^#[0-9A-F]{6}$" },
80
+ "color": {
81
+ "type": "object",
82
+ "additionalProperties": false,
83
+ "required": ["hex"],
84
+ "properties": {
85
+ "hex": { "$ref": "#/$defs/hex" },
86
+ "name": { "type": "string", "minLength": 1 }
87
+ }
88
+ }
89
+ }
90
+ }