@thi.ng/color 5.6.46 → 5.6.48

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**: 2024-06-21T19:34:38Z
3
+ - **Last updated**: 2024-07-06T12:02:18Z
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.
@@ -9,6 +9,14 @@ See [Conventional Commits](https://conventionalcommits.org/) for commit guidelin
9
9
  **Note:** Unlisted _patch_ versions only involve non-code or otherwise excluded changes
10
10
  and/or version bumps of transitive dependencies.
11
11
 
12
+ ### [5.6.47](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.6.47) (2024-06-29)
13
+
14
+ #### 🩹 Bug fixes
15
+
16
+ - update color ctor handling for single ARGB int args ([8ab6083](https://github.com/thi-ng/umbrella/commit/8ab6083))
17
+ - interpret sole int arg as sRGB, **not** as linear RGB
18
+ - add tests
19
+
12
20
  ### [5.6.46](https://github.com/thi-ng/umbrella/tree/@thi.ng/color@5.6.46) (2024-06-21)
13
21
 
14
22
  #### ♻️ Refactoring
package/README.md CHANGED
@@ -7,7 +7,7 @@
7
7
  [![Mastodon Follow](https://img.shields.io/mastodon/follow/109331703950160316?domain=https%3A%2F%2Fmastodon.thi.ng&style=social)](https://mastodon.thi.ng/@toxi)
8
8
 
9
9
  > [!NOTE]
10
- > This is one of 193 standalone projects, maintained as part
10
+ > This is one of 188 standalone projects, maintained as part
11
11
  > of the [@thi.ng/umbrella](https://github.com/thi-ng/umbrella/) monorepo
12
12
  > and anti-framework.
13
13
  >
package/defcolor.js CHANGED
@@ -15,7 +15,7 @@ import { randMinMax } from "@thi.ng/vectors/rand-minmax";
15
15
  import { set4 } from "@thi.ng/vectors/set";
16
16
  import { convert, defConversions } from "./convert.js";
17
17
  import { parseCss } from "./css/parse-css.js";
18
- import { intArgb32Rgb } from "./int/int-rgb.js";
18
+ import { intArgb32Srgb } from "./int/int-srgb.js";
19
19
  import { __ensureArgs } from "./internal/ensure.js";
20
20
  const defColor = (spec) => {
21
21
  const channels = spec.channels || {};
@@ -106,7 +106,7 @@ const defColor = (spec) => {
106
106
  const res = new $Color(...args);
107
107
  return mode !== spec.mode ? convert(res, src, spec.mode, mode) : res.set(src);
108
108
  };
109
- const factory = (src, ...args) => src == null ? new $Color() : isString(src) ? factory(parseCss(src), ...args) : isArrayLike(src) ? isString(src.mode) ? fromColor(src, src.mode, args) : new $Color(src, ...args) : implementsFunction(src, "deref") ? fromColor(src.deref(), src.mode, args) : isNumber(src) ? args.length && args.every(isNumber) ? new $Color(...__ensureArgs([src, ...args])) : fromColor(intArgb32Rgb([], src), "rgb", args) : illegalArgs(`can't create a ${spec.mode} color from: ${src}`);
109
+ const factory = (src, ...args) => src == null ? new $Color() : isString(src) ? factory(parseCss(src), ...args) : isArrayLike(src) ? isString(src.mode) ? fromColor(src, src.mode, args) : new $Color(src, ...args) : implementsFunction(src, "deref") ? fromColor(src.deref(), src.mode, args) : isNumber(src) ? args.length && args.every(isNumber) ? new $Color(...__ensureArgs([src, ...args])) : fromColor(intArgb32Srgb([], src), "srgb", args) : illegalArgs(`can't create a ${spec.mode} color from: ${src}`);
110
110
  factory.class = $Color;
111
111
  factory.range = [min, max];
112
112
  factory.random = (rnd, buf, idx, stride) => new $Color(buf, idx, stride).randomize(rnd);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thi.ng/color",
3
- "version": "5.6.46",
3
+ "version": "5.6.48",
4
4
  "description": "Array-based color types, CSS parsing, conversions, transformations, declarative theme generation, gradients, presets",
5
5
  "type": "module",
6
6
  "module": "./index.js",
@@ -40,25 +40,25 @@
40
40
  "tool:tangle": "../../node_modules/.bin/tangle src/**/*.ts"
41
41
  },
42
42
  "dependencies": {
43
- "@thi.ng/api": "^8.11.3",
44
- "@thi.ng/arrays": "^2.9.7",
45
- "@thi.ng/binary": "^3.4.26",
46
- "@thi.ng/checks": "^3.6.5",
47
- "@thi.ng/compare": "^2.3.6",
48
- "@thi.ng/compose": "^3.0.5",
49
- "@thi.ng/defmulti": "^3.0.40",
50
- "@thi.ng/errors": "^2.5.8",
51
- "@thi.ng/math": "^5.11.0",
52
- "@thi.ng/random": "^3.8.1",
53
- "@thi.ng/strings": "^3.7.34",
54
- "@thi.ng/transducers": "^9.0.6",
55
- "@thi.ng/vectors": "^7.11.0"
43
+ "@thi.ng/api": "^8.11.5",
44
+ "@thi.ng/arrays": "^2.9.9",
45
+ "@thi.ng/binary": "^3.4.28",
46
+ "@thi.ng/checks": "^3.6.7",
47
+ "@thi.ng/compare": "^2.3.8",
48
+ "@thi.ng/compose": "^3.0.7",
49
+ "@thi.ng/defmulti": "^3.0.42",
50
+ "@thi.ng/errors": "^2.5.10",
51
+ "@thi.ng/math": "^5.11.2",
52
+ "@thi.ng/random": "^3.8.3",
53
+ "@thi.ng/strings": "^3.7.36",
54
+ "@thi.ng/transducers": "^9.0.8",
55
+ "@thi.ng/vectors": "^7.11.2"
56
56
  },
57
57
  "devDependencies": {
58
58
  "@microsoft/api-extractor": "^7.47.0",
59
- "esbuild": "^0.21.5",
60
- "typedoc": "^0.25.13",
61
- "typescript": "^5.5.2"
59
+ "esbuild": "^0.23.0",
60
+ "typedoc": "^0.26.3",
61
+ "typescript": "^5.5.3"
62
62
  },
63
63
  "keywords": [
64
64
  "color",
@@ -445,5 +445,5 @@
445
445
  "vectors"
446
446
  ]
447
447
  },
448
- "gitHead": "154c95cf9d6bab32174498ec3b5b5d87e42be7f9\n"
448
+ "gitHead": "70f493d9ccc97c5df5dda7e808e96cd1691097fc\n"
449
449
  }