@thi.ng/color-palettes 0.9.3 → 0.9.5

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/CHANGELOG.md CHANGED
@@ -1,6 +1,6 @@
1
1
  # Change Log
2
2
 
3
- - **Last updated**: 2022-10-28T19:08:39Z
3
+ - **Last updated**: 2022-11-30T22:27:37Z
4
4
  - **Generator**: [thi.ng/monopub](https://thi.ng/monopub)
5
5
 
6
6
  All notable changes to this project will be documented in this file.
@@ -20,8 +20,8 @@ and/or version bumps of transitive dependencies.
20
20
 
21
21
  #### 🚀 Features
22
22
 
23
- - add new themes ([f3d4446](https://github.com/thi-ng/umbrella/commit/f3d4446))
24
23
  - add 12 new palettes ([eab99c7](https://github.com/thi-ng/umbrella/commit/eab99c7))
24
+ - add new themes ([f3d4446](https://github.com/thi-ng/umbrella/commit/f3d4446))
25
25
 
26
26
  ## [0.7.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/color-palettes@0.7.0) (2021-12-02)
27
27
 
@@ -37,13 +37,13 @@ and/or version bumps of transitive dependencies.
37
37
 
38
38
  #### 🚀 Features
39
39
 
40
+ - add new themes, update swatch gen ([69f269a](https://github.com/thi-ng/umbrella/commit/69f269a))
41
+ - update readme, add table w/ recent additions
40
42
  - Using workspaces for local tools ([bf7a404](https://github.com/thi-ng/umbrella/commit/bf7a404))
41
43
  Improving the overall build ergonomics
42
44
  - introduced a tools workspaces
43
45
  - imported it in all needed packages/examples
44
46
  - inclusive project root
45
- - add new themes, update swatch gen ([69f269a](https://github.com/thi-ng/umbrella/commit/69f269a))
46
- - update readme, add table w/ recent additions
47
47
 
48
48
  #### ♻️ Refactoring
49
49
 
@@ -85,16 +85,16 @@ and/or version bumps of transitive dependencies.
85
85
 
86
86
  #### ♻️ Refactoring
87
87
 
88
- - update all test stubs ([f2d6d53](https://github.com/thi-ng/umbrella/commit/f2d6d53))
89
88
  - update all tests in _all_ pkgs ([8b582bc](https://github.com/thi-ng/umbrella/commit/8b582bc))
90
89
  - update all to use [@thi.ng/testament](https://github.com/thi-ng/umbrella/tree/main/packages/testament)
90
+ - update all test stubs ([f2d6d53](https://github.com/thi-ng/umbrella/commit/f2d6d53))
91
91
 
92
92
  ## [0.3.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/color-palettes@0.3.0) (2021-08-24)
93
93
 
94
94
  #### 🚀 Features
95
95
 
96
- - add new palettes, update readme ([14f2952](https://github.com/thi-ng/umbrella/commit/14f2952))
97
96
  - update/simplify swatch gen ([3187949](https://github.com/thi-ng/umbrella/commit/3187949))
97
+ - add new palettes, update readme ([14f2952](https://github.com/thi-ng/umbrella/commit/14f2952))
98
98
 
99
99
  ## [0.2.0](https://github.com/thi-ng/umbrella/tree/@thi.ng/color-palettes@0.2.0) (2021-08-22)
100
100
 
package/README.md CHANGED
@@ -221,7 +221,7 @@ node --experimental-repl-await
221
221
  > const colorPalettes = await import("@thi.ng/color-palettes");
222
222
  ```
223
223
 
224
- Package sizes (gzipped, pre-treeshake): ESM: 7.72 KB
224
+ Package sizes (brotli'd, pre-treeshake): ESM: 6.20 KB
225
225
 
226
226
  ## Dependencies
227
227
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color-palettes",
3
- "version": "0.9.3",
3
+ "version": "0.9.5",
4
4
  "description": "Collection of 190+ image based color palettes",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -36,10 +36,10 @@
36
36
  },
37
37
  "devDependencies": {
38
38
  "@microsoft/api-extractor": "^7.33.5",
39
- "@thi.ng/testament": "^0.3.4",
39
+ "@thi.ng/testament": "^0.3.6",
40
40
  "rimraf": "^3.0.2",
41
41
  "tools": "^0.0.1",
42
- "typedoc": "^0.23.18",
42
+ "typedoc": "^0.23.20",
43
43
  "typescript": "^4.8.4"
44
44
  },
45
45
  "keywords": [
@@ -60,8 +60,8 @@
60
60
  "node": ">=12.7"
61
61
  },
62
62
  "files": [
63
- "*.js",
64
- "*.d.ts"
63
+ "./*.js",
64
+ "./*.d.ts"
65
65
  ],
66
66
  "exports": {
67
67
  ".": {
@@ -72,5 +72,5 @@
72
72
  "parent": "@thi.ng/color",
73
73
  "year": 2021
74
74
  },
75
- "gitHead": "41e59c7ad9bf24bb0230a5f60d05715e0fc1c1e6\n"
75
+ "gitHead": "1fe40da507070653f420156d91e6b27cf682004f\n"
76
76
  }
package/dev/namegen.js DELETED
@@ -1,505 +0,0 @@
1
- function shuffled(list) {
2
- var newlist = [];
3
- for (var i = 0; i < list.length; i++) {
4
- newlist.push(list[i]);
5
- }
6
- for (var i = list.length - 1; i > 0; i--) {
7
- var tmp = newlist[i];
8
- var j = randrange(i);
9
- newlist[i] = newlist[j];
10
- newlist[j] = tmp;
11
- }
12
- return newlist;
13
- }
14
-
15
- function choose(list, exponent) {
16
- exponent = exponent || 1;
17
- return list[Math.floor(Math.pow(Math.random(), exponent) * list.length)];
18
- }
19
-
20
- function randrange(lo, hi) {
21
- if (hi == undefined) {
22
- hi = lo;
23
- lo = 0;
24
- }
25
- return Math.floor(Math.random() * (hi - lo)) + lo;
26
- }
27
-
28
- function join(list, sep) {
29
- if (list.length == 0) return "";
30
- sep = sep || "";
31
- var s = list[0];
32
- for (var i = 1; i < list.length; i++) {
33
- s += sep;
34
- s += list[i];
35
- }
36
- return s;
37
- }
38
-
39
- function capitalize(word) {
40
- return word[0].toUpperCase() + word.slice(1);
41
- }
42
-
43
- function spell(lang, syll) {
44
- if (lang.noortho) return syll;
45
- var s = "";
46
- for (var i = 0; i < syll.length; i++) {
47
- var c = syll[i];
48
- s += lang.cortho[c] || lang.vortho[c] || defaultOrtho[c] || c;
49
- }
50
- return s;
51
- }
52
-
53
- function makeSyllable(lang) {
54
- while (true) {
55
- var syll = "";
56
- for (var i = 0; i < lang.structure.length; i++) {
57
- var ptype = lang.structure[i];
58
- if (lang.structure[i + 1] == "?") {
59
- i++;
60
- if (Math.random() < 0.5) {
61
- continue;
62
- }
63
- }
64
- syll += choose(lang.phonemes[ptype], lang.exponent);
65
- }
66
- var bad = false;
67
- for (var i = 0; i < lang.restricts.length; i++) {
68
- if (lang.restricts[i].test(syll)) {
69
- bad = true;
70
- break;
71
- }
72
- }
73
- if (bad) continue;
74
- return spell(lang, syll);
75
- }
76
- }
77
-
78
- function getMorpheme(lang, key) {
79
- if (lang.nomorph) {
80
- return makeSyllable(lang);
81
- }
82
- key = key || "";
83
- var list = lang.morphemes[key] || [];
84
- var extras = 10;
85
- if (key) extras = 1;
86
- while (true) {
87
- var n = randrange(list.length + extras);
88
- if (list[n]) return list[n];
89
- var morph = makeSyllable(lang);
90
- var bad = false;
91
- for (var k in lang.morphemes) {
92
- if (lang.morphemes[k].includes(morph)) {
93
- bad = true;
94
- break;
95
- }
96
- }
97
- if (bad) continue;
98
- list.push(morph);
99
- lang.morphemes[key] = list;
100
- return morph;
101
- }
102
- }
103
-
104
- function makeWord(lang, key) {
105
- var nsylls = randrange(lang.minsyll, lang.maxsyll + 1);
106
- var w = "";
107
- var keys = [];
108
- keys[randrange(nsylls)] = key;
109
- for (var i = 0; i < nsylls; i++) {
110
- w += getMorpheme(lang, keys[i]);
111
- }
112
- return w;
113
- }
114
-
115
- function getWord(lang, key) {
116
- key = key || "";
117
- var ws = lang.words[key] || [];
118
- var extras = 3;
119
- if (key) extras = 2;
120
- while (true) {
121
- var n = randrange(ws.length + extras);
122
- var w = ws[n];
123
- if (w) {
124
- return w;
125
- }
126
- w = makeWord(lang, key);
127
- var bad = false;
128
- for (var k in lang.words) {
129
- if (lang.words[k].includes(w)) {
130
- bad = true;
131
- break;
132
- }
133
- }
134
- if (bad) continue;
135
- ws.push(w);
136
- lang.words[key] = ws;
137
- return w;
138
- }
139
- }
140
- function makeName(lang, key) {
141
- key = key || "";
142
- lang.genitive = lang.genitive || getMorpheme(lang, "of");
143
- lang.definite = lang.definite || getMorpheme(lang, "the");
144
- while (true) {
145
- var name = null;
146
- if (Math.random() < 0.5) {
147
- name = capitalize(getWord(lang, key));
148
- } else {
149
- var w1 = capitalize(getWord(lang, Math.random() < 0.6 ? key : ""));
150
- var w2 = capitalize(getWord(lang, Math.random() < 0.6 ? key : ""));
151
- if (w1 == w2) continue;
152
- if (Math.random() > 0.5) {
153
- name = join([w1, w2], lang.joiner);
154
- } else {
155
- name = join([w1, lang.genitive, w2], lang.joiner);
156
- }
157
- }
158
- if (Math.random() < 0.1) {
159
- name = join([lang.definite, name], lang.joiner);
160
- }
161
-
162
- if (name.length < lang.minchar || name.length > lang.maxchar) continue;
163
- var used = false;
164
- for (var i = 0; i < lang.names.length; i++) {
165
- var name2 = lang.names[i];
166
- if (name.indexOf(name2) != -1 || name2.indexOf(name) != -1) {
167
- used = true;
168
- break;
169
- }
170
- }
171
- if (used) continue;
172
- lang.names.push(name);
173
- return name;
174
- }
175
- }
176
-
177
- function makeBasicLanguage() {
178
- return {
179
- phonemes: {
180
- C: "ptkmnls",
181
- V: "aeiou",
182
- S: "s",
183
- F: "mn",
184
- L: "rl",
185
- },
186
- structure: "CVC",
187
- exponent: 2,
188
- restricts: [],
189
- cortho: {},
190
- vortho: {},
191
- noortho: true,
192
- nomorph: true,
193
- nowordpool: true,
194
- minsyll: 1,
195
- maxsyll: 1,
196
- morphemes: {},
197
- words: {},
198
- names: [],
199
- joiner: " ",
200
- maxchar: 12,
201
- minchar: 5,
202
- };
203
- }
204
-
205
- function makeOrthoLanguage() {
206
- var lang = makeBasicLanguage();
207
- lang.noortho = false;
208
- return lang;
209
- }
210
-
211
- function makeRandomLanguage() {
212
- var lang = makeBasicLanguage();
213
- lang.noortho = false;
214
- lang.nomorph = false;
215
- lang.nowordpool = false;
216
- lang.phonemes.C = shuffled(choose(consets, 2).C);
217
- lang.phonemes.V = shuffled(choose(vowsets, 2).V);
218
- lang.phonemes.L = shuffled(choose(lsets, 2).L);
219
- lang.phonemes.S = shuffled(choose(ssets, 2).S);
220
- lang.phonemes.F = shuffled(choose(fsets, 2).F);
221
- lang.structure = choose(syllstructs);
222
- lang.restricts = ressets[2].res;
223
- lang.cortho = choose(corthsets, 2).orth;
224
- lang.vortho = choose(vorthsets, 2).orth;
225
- lang.minsyll = randrange(1, 3);
226
- if (lang.structure.length < 3) lang.minsyll++;
227
- lang.maxsyll = randrange(lang.minsyll + 1, 7);
228
- lang.joiner = choose(" -");
229
- return lang;
230
- }
231
- var defaultOrtho = {
232
- ʃ: "sh",
233
- ʒ: "zh",
234
- ʧ: "ch",
235
- ʤ: "j",
236
- ŋ: "ng",
237
- j: "y",
238
- x: "kh",
239
- ɣ: "gh",
240
- ʔ: "‘",
241
- A: "á",
242
- E: "é",
243
- I: "í",
244
- O: "ó",
245
- U: "ú",
246
- };
247
-
248
- var corthsets = [
249
- {
250
- name: "Default",
251
- orth: {},
252
- },
253
- {
254
- name: "Slavic",
255
- orth: {
256
- ʃ: "š",
257
- ʒ: "ž",
258
- ʧ: "č",
259
- ʤ: "ǧ",
260
- j: "j",
261
- },
262
- },
263
- {
264
- name: "German",
265
- orth: {
266
- ʃ: "sch",
267
- ʒ: "zh",
268
- ʧ: "tsch",
269
- ʤ: "dz",
270
- j: "j",
271
- x: "ch",
272
- },
273
- },
274
- {
275
- name: "French",
276
- orth: {
277
- ʃ: "ch",
278
- ʒ: "j",
279
- ʧ: "tch",
280
- ʤ: "dj",
281
- x: "kh",
282
- },
283
- },
284
- {
285
- name: "Chinese (pinyin)",
286
- orth: {
287
- ʃ: "x",
288
- ʧ: "q",
289
- ʤ: "j",
290
- },
291
- },
292
- ];
293
-
294
- var vorthsets = [
295
- {
296
- name: "Ácutes",
297
- orth: {},
298
- },
299
- {
300
- name: "Ümlauts",
301
- orth: {
302
- A: "ä",
303
- E: "ë",
304
- I: "ï",
305
- O: "ö",
306
- U: "ü",
307
- },
308
- },
309
- {
310
- name: "Welsh",
311
- orth: {
312
- A: "â",
313
- E: "ê",
314
- I: "y",
315
- O: "ô",
316
- U: "w",
317
- },
318
- },
319
- {
320
- name: "Diphthongs",
321
- orth: {
322
- A: "au",
323
- E: "ei",
324
- I: "ie",
325
- O: "ou",
326
- U: "oo",
327
- },
328
- },
329
- {
330
- name: "Doubles",
331
- orth: {
332
- A: "aa",
333
- E: "ee",
334
- I: "ii",
335
- O: "oo",
336
- U: "uu",
337
- },
338
- },
339
- ];
340
-
341
- var consets = [
342
- {
343
- name: "Minimal",
344
- C: "ptkmnls",
345
- },
346
- {
347
- name: "English-ish",
348
- C: "ptkbdgmnlrsʃzʒʧ",
349
- },
350
- {
351
- name: "Pirahã (very simple)",
352
- C: "ptkmnh",
353
- },
354
- {
355
- name: "Hawaiian-ish",
356
- C: "hklmnpwʔ",
357
- },
358
- {
359
- name: "Greenlandic-ish",
360
- C: "ptkqvsgrmnŋlj",
361
- },
362
- {
363
- name: "Arabic-ish",
364
- C: "tksʃdbqɣxmnlrwj",
365
- },
366
- {
367
- name: "Arabic-lite",
368
- C: "tkdgmnsʃ",
369
- },
370
- {
371
- name: "English-lite",
372
- C: "ptkbdgmnszʒʧhjw",
373
- },
374
- ];
375
-
376
- var ssets = [
377
- {
378
- name: "Just s",
379
- S: "s",
380
- },
381
- {
382
- name: "s ʃ",
383
- S: "sʃ",
384
- },
385
- {
386
- name: "s ʃ f",
387
- S: "sʃf",
388
- },
389
- ];
390
-
391
- var lsets = [
392
- {
393
- name: "r l",
394
- L: "rl",
395
- },
396
- {
397
- name: "Just r",
398
- L: "r",
399
- },
400
- {
401
- name: "Just l",
402
- L: "l",
403
- },
404
- {
405
- name: "w j",
406
- L: "wj",
407
- },
408
- {
409
- name: "r l w j",
410
- L: "rlwj",
411
- },
412
- ];
413
-
414
- var fsets = [
415
- {
416
- name: "m n",
417
- F: "mn",
418
- },
419
- {
420
- name: "s k",
421
- F: "sk",
422
- },
423
- {
424
- name: "m n ŋ",
425
- F: "mnŋ",
426
- },
427
- {
428
- name: "s ʃ z ʒ",
429
- F: "sʃzʒ",
430
- },
431
- ];
432
-
433
- var vowsets = [
434
- {
435
- name: "Standard 5-vowel",
436
- V: "aeiou",
437
- },
438
- {
439
- name: "3-vowel a i u",
440
- V: "aiu",
441
- },
442
- {
443
- name: "Extra A E I",
444
- V: "aeiouAEI",
445
- },
446
- {
447
- name: "Extra U",
448
- V: "aeiouU",
449
- },
450
- {
451
- name: "5-vowel a i u A I",
452
- V: "aiuAI",
453
- },
454
- {
455
- name: "3-vowel e o u",
456
- V: "eou",
457
- },
458
- {
459
- name: "Extra A O U",
460
- V: "aeiouAOU",
461
- },
462
- ];
463
-
464
- var syllstructs = [
465
- "CVC",
466
- "CVV?C",
467
- "CVVC?",
468
- "CVC?",
469
- "CV",
470
- "VC",
471
- "CVF",
472
- "C?VC",
473
- "CVF?",
474
- "CL?VC",
475
- "CL?VF",
476
- "S?CVC",
477
- "S?CVF",
478
- "S?CVC?",
479
- "C?VF",
480
- "C?VC?",
481
- "C?VF?",
482
- "C?L?VC",
483
- "VC",
484
- "CVL?C?",
485
- "C?VL?C",
486
- "C?VLC?",
487
- ];
488
-
489
- var ressets = [
490
- {
491
- name: "None",
492
- res: [],
493
- },
494
- {
495
- name: "Double sounds",
496
- res: [/(.)\1/],
497
- },
498
- {
499
- name: "Doubles and hard clusters",
500
- res: [/[sʃf][sʃ]/, /(.)\1/, /[rl][rl]/],
501
- },
502
- ];
503
-
504
- exports.makeRandomLanguage = makeRandomLanguage;
505
- exports.makeName = makeName;