@labpics/colors 1.0.3 → 1.1.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.
package/README.md CHANGED
@@ -93,11 +93,12 @@ try {
93
93
  );
94
94
  try {
95
95
  if (snapshot.state === "ready") {
96
- for (let index = 0; index < snapshot.outputCount(); index += 1) {
96
+ const outputs = snapshot.copyOutputTable();
97
+ for (let row = 0; row < outputs.length; row += 5) {
97
98
  console.log(
98
- snapshot.outputSlot(index),
99
- snapshot.outputRgb(index),
100
- snapshot.outputOpacity(index),
99
+ outputs[row],
100
+ outputs[row + 1], outputs[row + 2], outputs[row + 3],
101
+ outputs[row + 4],
101
102
  );
102
103
  }
103
104
  }
@@ -111,6 +112,33 @@ try {
111
112
 
112
113
  Канонические `LCPW` v1 bytes создаются `ProgramWireBuilderV1` или другим реализационно-независимым энкодером того же контракта.
113
114
 
115
+ ## Чтение outputs
116
+
117
+ Для чтения всех цветов используйте `snapshot.copyOutputTable()` у
118
+ `ProgramSnapshot` и `ProgramAttachedSnapshot`. Один вызов возвращает
119
+ `Float64Array` длиной `outputCount() * 5`; каждая строка содержит:
120
+
121
+ | Смещение в строке | Значение |
122
+ | --- | --- |
123
+ | 0 | Непрозрачный клиентский `slot`, целое u32 |
124
+ | 1, 2, 3 | Красный, зелёный и синий канал sRGB8, целые `0..255` |
125
+ | 4 | Straight opacity, исходное f64 в `0..1` |
126
+
127
+ Строка `i` совпадает с `outputSlot(i)`, `outputRgb(i)` и `outputOpacity(i)`.
128
+ Слоты и каналы точно представимы в f64, opacity копируется без округления.
129
+ Каждый вызов создаёт независимый JS-буфер: его изменение не меняет snapshot,
130
+ другую таблицу или runtime. Таблица остаётся доступна после следующего update
131
+ и `free()` снимка или владельца. Поштучные геттеры доступны, когда нужен один
132
+ output.
133
+
134
+ Перед применением цветов проверяйте `snapshot.state === "ready"`.
135
+ `failed` и `stale` могут содержать последние проверенные значения, которые
136
+ не удостоверены для текущего контекста; таблица сохраняет эту же семантику.
137
+ Снимок без outputs возвращает пустой `Float64Array`.
138
+ Если не удаётся выделить Rust-таблицу или создать её JS-копию, метод бросает ошибку
139
+ `{ code: "program_resource_exhausted", operation: "copyOutputTable" }`,
140
+ распознаваемую `isProgramError`. Снимок при отказе не меняется.
141
+
114
142
  ## Явная конвенция cleanliness
115
143
 
116
144
  Чтобы выбранный результат удовлетворял встроенной конвенции sRGB8, добавьте
@@ -2,22 +2,22 @@
2
2
  "schemaVersion": 2,
3
3
  "package": {
4
4
  "name": "@labpics/colors",
5
- "version": "1.0.3"
5
+ "version": "1.1.0"
6
6
  },
7
- "sourceSha": "3f45c7e522f9a609b4cac69745c860d51f27b3fb",
7
+ "sourceSha": "a00f1215ad151366c84d818e8d2fb92bf1b1f8e5",
8
8
  "coreVersion": "0.3.0",
9
9
  "conformance": {
10
- "packVersion": "12.0.0",
11
- "packDigest": "4487d438",
12
- "manifestSha256": "3bc874bcede5a2c7b8afa73e93f30f594d848b9ff4b63a0aca822633aec0204b",
13
- "familySetSha256": "433250df0b41e6d2c55312c6489d19019f34e47b796b9a6a8dd1a826eacc4ecc"
10
+ "packVersion": "13.0.0",
11
+ "packDigest": "ab63bf70",
12
+ "manifestSha256": "845265aa61cc067978c5604585127d88601cb1a196ab6c21c4f29f80db170622",
13
+ "familySetSha256": "b04a5894861ba7d11295fb7e944cc257add26c02c81a4aa55d5967baa143b82b"
14
14
  },
15
15
  "wasm": [
16
16
  {
17
17
  "role": "runtime",
18
18
  "path": "pkg/labcolors_bg.wasm",
19
- "bytes": 442027,
20
- "sha256": "a39d1b53f9f0e5253eb2768a7d6402cdedba497415564c1ce8ba3d2e99763684"
19
+ "bytes": 627400,
20
+ "sha256": "e95ad4856901300e11717fd1231f0401ac81618b99f861460005a69e6892ea3e"
21
21
  }
22
22
  ]
23
23
  }
@@ -1 +1 @@
1
- {"artifact_id":"wcag22-srgb8-luminance-q55-v1","basis_point_proof":{"checks":30,"drop_all_semantics":"zero required surplus; current must still meet the anchor","drop_domain_inclusive":[0,10000],"nonpositive_baseline_semantics":"zero required surplus; current must meet the anchor"},"bound_id":"point-support-reference-surplus-q55-bps-v1","certified_claim":"for every successfully evaluated enabled stability cell, decision is Retained iff current_lower_surplus >= (10000-drop_bps)/10000 * max(baseline_lower_surplus,0); the declared anchor remains a separate hard floor","comparator_proof":{"algorithm":"euclidean-continued-fraction-ordering-v1","dense_denominator_inclusive":[1,31],"dense_numerator_inclusive":[0,31],"dense_small_cases":984064,"invariant":"equal integer parts; reciprocal proper fractions reverse order","largest_fibonacci_index":186,"oracle":"unbounded-integer-cross-product","random_cases":250000,"random_corpus_sha256":"97c4af7b452b31a4ab92645f70c17acb38bf57ca55484e32ad9d7d79d97a333d","random_seed":210583930,"termination":"each nonterminal denominator becomes a strictly smaller remainder","u128_adversarial_cases":190},"declared_operation_law":"q55-lower-reference-distance-explicit-anchor-bps-retention-v1","excluded_claim":"does not certify retention against the unknown exact baseline surplus, renderer equivalence outside encoded-sRGB8 source-over, or a successful result when evaluation fails","integer_replay_envelope":{"assumption":"every Q55 luminance upper <= scale + 3","i128_max":170141183460469231731687303715884105727,"offset_cleared_denominator_max":756604737398243388,"positive_baseline_numerator_max":1188950301625811064,"rational_denominator_max":1513209474796486776,"required_denominator_max":15132094747964867760000,"required_numerator_max":11889503016258110640000,"signed_anchor_abs_coarse_max":5296233161787703716,"u128_max":340282366920938463463374607431768211455,"u64_max":18446744073709551615},"profile_id":"srgb8-q55-retained-reference-surplus-bps-v1","proof_id":"point-support-reference-surplus-integer-v1","proof_payload_sha256":"62208d41239f9c7cfe645d2ba10bc28a779a0d6b0b6066c4570a501d9e9c7c5d","q55_dependency":{"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","maximum_luminance_upper":36028797018963971,"outward_interval_width_bound":3,"proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"a4e02b4dce47c58310fb3ea9e34af1538ae5813b31b15ddee71a9a1be7bb76f8","proof_sha256":"2b2170e20bd24c059a0bbaf8d92603470ec941402f3a08185f54a5e1e41c69ca","q55_scale":36028797018963968},"reference_and_anchor_proof":{"anchor_identity_checks":75,"orientation_law":"distance-magnitude-symmetric-orientation-reported-separately","overlap_lower_distance":"0/1","separated_endpoint_checks":504},"schema_version":2,"site_id":"point-support-retained-reference-surplus-v1","source_binding_exclusions":["whole-crate compilation or compiler/toolchain attestation","binary, package, FFI, renderer, or browser transport attestation","unrelated Lab Colors modules outside the declared point-support semantic cone"],"source_binding_law":"point-support-rust-whole-file-semantic-cone-v2","source_binding_schema_version":2,"source_binding_scope":"exact bytes of the private point-support Rust semantic cone and its two WCAG include_str inputs; comments and cfg(test) text are intentionally significant","source_closure_sha256":"5fa4305e060086a3e5df3f0da33fcb297c3c7527f7daed4d941a5b090a6e08b8","source_files":[{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-q55-proof-v1.json","sha256":"2b2170e20bd24c059a0bbaf8d92603470ec941402f3a08185f54a5e1e41c69ca"},{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-v1.json","sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b"},{"kind":"rust-source","path":"crates/labcolors-core/src/appearance.rs","sha256":"9e6fa6fc6efac242d118e92bf416c8547d043e965d7b681610fa6a5baa447dc3"},{"kind":"rust-source","path":"crates/labcolors-core/src/composition.rs","sha256":"66506ab70fbe9223486ebfd480dd114542c6acab81115880871db56fe923e134"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/exact.rs","sha256":"ae9d95c3aa08142192ff422cd7a5bd514855d47f58c8e54aaffb69bfd7481afc"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/mod.rs","sha256":"93f914875c0a0780e612bfedad1b52f75aa63429e53a2242346db13031e4a0cd"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/wcag22.rs","sha256":"63b78e4a4669d2b237812ffd62b4b9b5cb3761d9a6856f508ad50da68ab611fb"},{"kind":"rust-source","path":"crates/labcolors-core/src/hash.rs","sha256":"f97a0fd7d6ad3162f0f1dfb326fccfb7ed40da9a8fa67a5b8a239a1ae2ae49c3"},{"kind":"rust-source","path":"crates/labcolors-core/src/lcs_occurrence.rs","sha256":"78d37406e9bdc37f126b72987c9c92b452c13b3233c0aeb0a75ed25dadb83a68"},{"kind":"rust-source","path":"crates/labcolors-core/src/lib.rs","sha256":"bae7d0c4fd0fd554c3c23dddac33c45e60c987300e67558d205d12336b2498a0"},{"kind":"rust-source","path":"crates/labcolors-core/src/numerics.rs","sha256":"94ab17694b86e724e149570dfda8fafa71619f1c1015dcb7af421bc72d44ff22"},{"kind":"rust-source","path":"crates/labcolors-core/src/observation.rs","sha256":"b9ea44b2b0a471ba86e791abacaab17cb3475744676575d1520de9629346199b"},{"kind":"rust-source","path":"crates/labcolors-core/src/point_support.rs","sha256":"f8c12113a1487cc33dc289621d16e54ef84ba99a65bc370dead1da185228f17e"},{"kind":"rust-source","path":"crates/labcolors-core/src/session.rs","sha256":"b21c6a41e24349ec37e6311a3a51d8bc29b81cdbaea9f36bb04b3ce838b044bc"},{"kind":"rust-source","path":"crates/labcolors-core/src/srgb8.rs","sha256":"c8d600491f92c86c79b33ae2643787c52bb616028a48cd66bd711ba27d0b19d7"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22.rs","sha256":"15de885a352794944993d00f61ccdab9ec78d12777efd247bfbff0004be89a4f"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/kernel.rs","sha256":"8ab231b0a7fac8ebf78e04c3a2e70c1a7e477fdd3324ffa9d0eb100e89df1059"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/q55_data.rs","sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22_evidence.rs","sha256":"19dea4c88a75414c6869bedc0a36058a884d73f36ed9cb5c2f243764f10ac5dc"}],"source_negative_controls":43,"universal_algebraic_certificate":{"basis_point_scale_instantiation":10000,"domain":"integers; Q55 scale Q>0; anchor L>=D>=0; lighter monotonicity L2>=L1>D>=0; darker monotonicity L>D2>=D1>=0; current/baseline denominators b,q>0; basis-point scale B>0 instantiated as 10000; p>0; a>=0; 0<=drop_bps<=B","identities":["three explicit anchor-surplus formulas after denominator clearing","reference distance is monotone increasing in lighter L","reference distance is monotone decreasing in darker D","positive-baseline retained threshold is p*(B-drop)/(q*B)","a/b >= p*(B-drop)/(q*B) iff a*q*B >= p*(B-drop)*b"],"method":"exact-sparse-integer-polynomial-identities-plus-positive-denominator-order-lemma-v1","nonpositive_baseline_case":"max(baseline,0)=0; retained threshold is exactly zero","symbolic_mutation_controls":{"anchor_coefficients_and_denominator":6,"retained_cross_product":5},"wolfram_language_cross_check":{"query":"FullSimplify[{20 g/d - 0 == 20 g/d, 20 g/d - 2 == (20 g - 2 d)/d, 20 g/d - 7/2 == (40 g - 7 d)/(2 d), Equivalent[a/b >= p (s-x)/(q s), a q s >= p (s-x) b], Max[p/q, 0] (s-x)/s == Piecewise[{{0, p <= 0}}, p (s-x)/(q s)]}, Assumptions -> Element[{a,b,p,q,s,x,g,d}, Integers] && a >= 0 && b > 0 && q > 0 && s > 0 && 0 <= x <= s && d > 0 && g >= 0]","query_sha256":"8cdbb9964583030c8b92498961896cb2a98613f1cb31eb7c54acdf8e16beff10","result":"{True, True, True, True, True}","result_sha256":"13a8f2ee8d0fde335a638e46d7cc8a8427b9a1437c77d22cfcf925bb87fa6303"}},"verifier_sha256":"1a338442048e022df09a27608e3a9934da1bd0964fab2d050ede560f118b29d2"}
1
+ {"artifact_id":"wcag22-srgb8-luminance-q55-v1","basis_point_proof":{"checks":30,"drop_all_semantics":"zero required surplus; current must still meet the anchor","drop_domain_inclusive":[0,10000],"nonpositive_baseline_semantics":"zero required surplus; current must meet the anchor"},"bound_id":"point-support-reference-surplus-q55-bps-v1","certified_claim":"for every successfully evaluated enabled stability cell, decision is Retained iff current_lower_surplus >= (10000-drop_bps)/10000 * max(baseline_lower_surplus,0); the declared anchor remains a separate hard floor","comparator_proof":{"algorithm":"euclidean-continued-fraction-ordering-v1","dense_denominator_inclusive":[1,31],"dense_numerator_inclusive":[0,31],"dense_small_cases":984064,"invariant":"equal integer parts; reciprocal proper fractions reverse order","largest_fibonacci_index":186,"oracle":"unbounded-integer-cross-product","random_cases":250000,"random_corpus_sha256":"97c4af7b452b31a4ab92645f70c17acb38bf57ca55484e32ad9d7d79d97a333d","random_seed":210583930,"termination":"each nonterminal denominator becomes a strictly smaller remainder","u128_adversarial_cases":190},"declared_operation_law":"q55-lower-reference-distance-explicit-anchor-bps-retention-v1","excluded_claim":"does not certify retention against the unknown exact baseline surplus, renderer equivalence outside encoded-sRGB8 source-over, or a successful result when evaluation fails","integer_replay_envelope":{"assumption":"every Q55 luminance upper <= scale + 3","i128_max":170141183460469231731687303715884105727,"offset_cleared_denominator_max":756604737398243388,"positive_baseline_numerator_max":1188950301625811064,"rational_denominator_max":1513209474796486776,"required_denominator_max":15132094747964867760000,"required_numerator_max":11889503016258110640000,"signed_anchor_abs_coarse_max":5296233161787703716,"u128_max":340282366920938463463374607431768211455,"u64_max":18446744073709551615},"profile_id":"srgb8-q55-retained-reference-surplus-bps-v1","proof_id":"point-support-reference-surplus-integer-v1","proof_payload_sha256":"c52e2721dbca4902ae9d40870f97d0c8d1f373d26ff134fc2d0fdbd6bb420ec5","q55_dependency":{"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","maximum_luminance_upper":36028797018963971,"outward_interval_width_bound":3,"proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"659ec379cb71d6ac4e20272610626957c79e4531b53127257d9a19ffe6f3ae59","proof_sha256":"fce4e75c036274ede4ee20adfbdd8112512f8385244f852b71a8020afd87ef84","q55_scale":36028797018963968},"reference_and_anchor_proof":{"anchor_identity_checks":75,"orientation_law":"distance-magnitude-symmetric-orientation-reported-separately","overlap_lower_distance":"0/1","separated_endpoint_checks":504},"schema_version":2,"site_id":"point-support-retained-reference-surplus-v1","source_binding_exclusions":["whole-crate compilation or compiler/toolchain attestation","binary, package, FFI, renderer, or browser transport attestation","unrelated Lab Colors modules outside the declared point-support semantic cone"],"source_binding_law":"point-support-rust-whole-file-semantic-cone-v2","source_binding_schema_version":2,"source_binding_scope":"exact bytes of the private point-support Rust semantic cone and its two WCAG include_str inputs; comments and cfg(test) text are intentionally significant","source_closure_sha256":"a03c96a1d708abc7b69ca70f525e43be8eb4a6d4cb6bfaa396510fa07fe29949","source_files":[{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-q55-proof-v1.json","sha256":"fce4e75c036274ede4ee20adfbdd8112512f8385244f852b71a8020afd87ef84"},{"kind":"compile-time-input","path":"crates/labcolors-core/contracts/wcag22-srgb8-v1.json","sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b"},{"kind":"rust-source","path":"crates/labcolors-core/src/appearance.rs","sha256":"2a953a62d62a01884fc10a2f27fe5ebabae8e60805de9ff291f3ba8b32b16ef6"},{"kind":"rust-source","path":"crates/labcolors-core/src/composition.rs","sha256":"66506ab70fbe9223486ebfd480dd114542c6acab81115880871db56fe923e134"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/exact.rs","sha256":"ae9d95c3aa08142192ff422cd7a5bd514855d47f58c8e54aaffb69bfd7481afc"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/mod.rs","sha256":"93f914875c0a0780e612bfedad1b52f75aa63429e53a2242346db13031e4a0cd"},{"kind":"rust-source","path":"crates/labcolors-core/src/constraints/wcag22.rs","sha256":"63b78e4a4669d2b237812ffd62b4b9b5cb3761d9a6856f508ad50da68ab611fb"},{"kind":"rust-source","path":"crates/labcolors-core/src/hash.rs","sha256":"f97a0fd7d6ad3162f0f1dfb326fccfb7ed40da9a8fa67a5b8a239a1ae2ae49c3"},{"kind":"rust-source","path":"crates/labcolors-core/src/lcs_occurrence.rs","sha256":"78d37406e9bdc37f126b72987c9c92b452c13b3233c0aeb0a75ed25dadb83a68"},{"kind":"rust-source","path":"crates/labcolors-core/src/lib.rs","sha256":"bae7d0c4fd0fd554c3c23dddac33c45e60c987300e67558d205d12336b2498a0"},{"kind":"rust-source","path":"crates/labcolors-core/src/numerics.rs","sha256":"94ab17694b86e724e149570dfda8fafa71619f1c1015dcb7af421bc72d44ff22"},{"kind":"rust-source","path":"crates/labcolors-core/src/observation.rs","sha256":"8d4f57faf6953d8717ee9f1b21fbc059a0226c270130c0fe8de356771defa369"},{"kind":"rust-source","path":"crates/labcolors-core/src/point_support.rs","sha256":"f8c12113a1487cc33dc289621d16e54ef84ba99a65bc370dead1da185228f17e"},{"kind":"rust-source","path":"crates/labcolors-core/src/session.rs","sha256":"b21c6a41e24349ec37e6311a3a51d8bc29b81cdbaea9f36bb04b3ce838b044bc"},{"kind":"rust-source","path":"crates/labcolors-core/src/srgb8.rs","sha256":"c8d600491f92c86c79b33ae2643787c52bb616028a48cd66bd711ba27d0b19d7"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22.rs","sha256":"973397e06e344ca0fd17ec3c2dfd563daeea42915712df1589ac16c2a0294be1"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/kernel.rs","sha256":"f82a1bf356141a1cd79605c889bc0f67b7b861a35de4fe18745d71eee4f36a53"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22/q55_data.rs","sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2"},{"kind":"rust-source","path":"crates/labcolors-core/src/wcag22_evidence.rs","sha256":"d02b40a44cc24e813d7a00a20f198692b47215f28d6c942f2608836617794a71"}],"source_negative_controls":43,"universal_algebraic_certificate":{"basis_point_scale_instantiation":10000,"domain":"integers; Q55 scale Q>0; anchor L>=D>=0; lighter monotonicity L2>=L1>D>=0; darker monotonicity L>D2>=D1>=0; current/baseline denominators b,q>0; basis-point scale B>0 instantiated as 10000; p>0; a>=0; 0<=drop_bps<=B","identities":["three explicit anchor-surplus formulas after denominator clearing","reference distance is monotone increasing in lighter L","reference distance is monotone decreasing in darker D","positive-baseline retained threshold is p*(B-drop)/(q*B)","a/b >= p*(B-drop)/(q*B) iff a*q*B >= p*(B-drop)*b"],"method":"exact-sparse-integer-polynomial-identities-plus-positive-denominator-order-lemma-v1","nonpositive_baseline_case":"max(baseline,0)=0; retained threshold is exactly zero","symbolic_mutation_controls":{"anchor_coefficients_and_denominator":6,"retained_cross_product":5},"wolfram_language_cross_check":{"query":"FullSimplify[{20 g/d - 0 == 20 g/d, 20 g/d - 2 == (20 g - 2 d)/d, 20 g/d - 7/2 == (40 g - 7 d)/(2 d), Equivalent[a/b >= p (s-x)/(q s), a q s >= p (s-x) b], Max[p/q, 0] (s-x)/s == Piecewise[{{0, p <= 0}}, p (s-x)/(q s)]}, Assumptions -> Element[{a,b,p,q,s,x,g,d}, Integers] && a >= 0 && b > 0 && q > 0 && s > 0 && 0 <= x <= s && d > 0 && g >= 0]","query_sha256":"8cdbb9964583030c8b92498961896cb2a98613f1cb31eb7c54acdf8e16beff10","result":"{True, True, True, True, True}","result_sha256":"13a8f2ee8d0fde335a638e46d7cc8a8427b9a1437c77d22cfcf925bb87fa6303"}},"verifier_sha256":"95f1608872c3a6edfbd9412aa2a5efddb0e30c86cef321877a0202a8e62275b8"}
@@ -1 +1 @@
1
- {"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_rust_source_sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","artifact_words":1536,"bound_id":"wcag22-srgb8-outward-q55-v1","colors":16777216,"declared_operation_law":"final-srgb8-outward-q55-two-orientation-integer-threshold-v1","facade_id":"wcag22-srgb8-public-facade-v1","facade_normalized_sha256":"c2f252829577f1a5455b91afdccc1669ff0c964e10d8935db9e79b0c8ce251d6","full_domain_algorithm":"unique-q55-interval-monotone-boundary-v1","generator_sha256":"7ad72f53e26ebb74ebfc2d8945f833613fa1317bb441d821f518d012c8c09687","integer_replay_envelope":{"carrier":"signed-64","carrier_maximum":9223372036854775807,"headroom":2485986994308513251,"maximum_luminance_upper":36028797018963971,"maximum_threshold_term":6737385042546262556,"next_scale_maximum_threshold_term":13474770085092524572,"next_scale_power":56,"observed_interval_width":3,"outward_interval_width_bound":3},"kernel_id":"wcag22-srgb8-evaluation-kernel-v1","kernel_source_sha256":"8ab231b0a7fac8ebf78e04c3a2e70c1a7e477fdd3324ffa9d0eb100e89df1059","max_color_interval_width":3,"negative_controls":15,"parser_id":"encoded-srgb8-hex-parser-v1","parser_source_sha256":"70fc992594762b97c3191a721156161b7f188b29cd05ee555c1656fb3840aed0","profile_checksum":"152813fe","profile_id":"wcag22-srgb8-contrast-v1","profile_source_sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b","proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"a4e02b4dce47c58310fb3ea9e34af1538ae5813b31b15ddee71a9a1be7bb76f8","q55_scale":36028797018963968,"recommendation":"https://www.w3.org/TR/2024/REC-WCAG22-20241212/","registry_row_id":"wcag22-srgb8-contrast-v1","registry_row_negative_controls":10,"registry_row_sha256":"c91c5e185c432ae4a9fb9ea03e9838bf2565f2aabff56019e190aae97bfaa0f1","row_oracle":{"integer_tightness_cross_checks":768,"maximum_precision_used":72,"precision_schedule":[48,72,108,162],"rows_stable":768},"rows":768,"schema_version":2,"source_binding_law":"wcag22-rust-semantic-dependency-cone-v1","source_binding_schema_version":1,"source_route_sha256":"3b8dfe6f0a538e2e026484ff361dce97b1cee852e4e3029453b05915d49eef8c","terminal_evidence_id":"wcag22-srgb8-terminal-evidence-v1","terminal_evidence_source_sha256":"19dea4c88a75414c6869bedc0a36058a884d73f36ed9cb5c2f243764f10ac5dc","thresholds":[{"candidate_checks":0,"integer_law":{"dark_factor":30,"light_factor":10,"offset_factor":1},"minimum_fail_intervals":[{"bounds":[14728116861854887,14728116861854890],"rgb":"#89BB09"},{"bounds":[3708412386652940,3708412386652943],"rgb":"#8212DB"}],"minimum_fail_margin":3268,"minimum_pass_intervals":[{"bounds":[22947817375997342,22947817375997345],"rgb":"#32F120"},{"bounds":[6448312558033241,6448312558033244],"rgb":"#BF39C2"}],"minimum_pass_margin":12132,"threshold":"3.0","unresolved":0},{"candidate_checks":0,"integer_law":{"dark_factor":180,"light_factor":40,"offset_factor":7},"minimum_fail_intervals":[{"bounds":[9920609921116460,9920609921116463],"rgb":"#898CB8"},{"bounds":[803460098399708,803460098399711],"rgb":"#3E2217"}],"minimum_fail_margin":36696,"minimum_pass_intervals":[{"bounds":[9070597544121535,9070597544121538],"rgb":"#BE64DB"},{"bounds":[614568459067254,614568459067257],"rgb":"#480B1D"}],"minimum_pass_margin":7364,"threshold":"4.5","unresolved":0}],"unique_intervals":16777216,"verifier_sha256":"d22dedc689925ffe53d49d3c4b4b0d3ae67a97d26062b2fdd24bcb404e31f768"}
1
+ {"artifact_id":"wcag22-srgb8-luminance-q55-v1","artifact_rust_source_sha256":"af4d23d6b70c45ce6efa839e7dda4bb0a61f6aae43cb805af6fa9b29e6c3bae2","artifact_sha256":"7ff239d9052b346f3c50da01ca65ca2330892ed1a3ff30e190797fcef6f03604","artifact_words":1536,"bound_id":"wcag22-srgb8-outward-q55-v1","colors":16777216,"declared_operation_law":"final-srgb8-outward-q55-two-orientation-integer-threshold-v1","facade_id":"wcag22-srgb8-public-facade-v1","facade_normalized_sha256":"c2f252829577f1a5455b91afdccc1669ff0c964e10d8935db9e79b0c8ce251d6","full_domain_algorithm":"unique-q55-interval-monotone-boundary-v1","generator_sha256":"7ad72f53e26ebb74ebfc2d8945f833613fa1317bb441d821f518d012c8c09687","integer_replay_envelope":{"carrier":"signed-64","carrier_maximum":9223372036854775807,"headroom":2485986994308513251,"maximum_luminance_upper":36028797018963971,"maximum_threshold_term":6737385042546262556,"next_scale_maximum_threshold_term":13474770085092524572,"next_scale_power":56,"observed_interval_width":3,"outward_interval_width_bound":3},"kernel_id":"wcag22-srgb8-evaluation-kernel-v1","kernel_source_sha256":"f82a1bf356141a1cd79605c889bc0f67b7b861a35de4fe18745d71eee4f36a53","max_color_interval_width":3,"negative_controls":15,"parser_id":"encoded-srgb8-hex-parser-v1","parser_source_sha256":"70fc992594762b97c3191a721156161b7f188b29cd05ee555c1656fb3840aed0","profile_checksum":"152813fe","profile_id":"wcag22-srgb8-contrast-v1","profile_source_sha256":"b4bb7e5f17a99f2c911fdbe3da23a48b049277b796291094950f14680cc3cc7b","proof_id":"wcag22-srgb8-full-domain-q55-v1","proof_payload_sha256":"659ec379cb71d6ac4e20272610626957c79e4531b53127257d9a19ffe6f3ae59","q55_scale":36028797018963968,"recommendation":"https://www.w3.org/TR/2024/REC-WCAG22-20241212/","registry_row_id":"wcag22-srgb8-contrast-v1","registry_row_negative_controls":10,"registry_row_sha256":"c91c5e185c432ae4a9fb9ea03e9838bf2565f2aabff56019e190aae97bfaa0f1","row_oracle":{"integer_tightness_cross_checks":768,"maximum_precision_used":72,"precision_schedule":[48,72,108,162],"rows_stable":768},"rows":768,"schema_version":2,"source_binding_law":"wcag22-rust-semantic-dependency-cone-v1","source_binding_schema_version":1,"source_route_sha256":"3b8dfe6f0a538e2e026484ff361dce97b1cee852e4e3029453b05915d49eef8c","terminal_evidence_id":"wcag22-srgb8-terminal-evidence-v1","terminal_evidence_source_sha256":"d02b40a44cc24e813d7a00a20f198692b47215f28d6c942f2608836617794a71","thresholds":[{"candidate_checks":0,"integer_law":{"dark_factor":30,"light_factor":10,"offset_factor":1},"minimum_fail_intervals":[{"bounds":[14728116861854887,14728116861854890],"rgb":"#89BB09"},{"bounds":[3708412386652940,3708412386652943],"rgb":"#8212DB"}],"minimum_fail_margin":3268,"minimum_pass_intervals":[{"bounds":[22947817375997342,22947817375997345],"rgb":"#32F120"},{"bounds":[6448312558033241,6448312558033244],"rgb":"#BF39C2"}],"minimum_pass_margin":12132,"threshold":"3.0","unresolved":0},{"candidate_checks":0,"integer_law":{"dark_factor":180,"light_factor":40,"offset_factor":7},"minimum_fail_intervals":[{"bounds":[9920609921116460,9920609921116463],"rgb":"#898CB8"},{"bounds":[803460098399708,803460098399711],"rgb":"#3E2217"}],"minimum_fail_margin":36696,"minimum_pass_intervals":[{"bounds":[9070597544121535,9070597544121538],"rgb":"#BE64DB"},{"bounds":[614568459067254,614568459067257],"rgb":"#480B1D"}],"minimum_pass_margin":7364,"threshold":"4.5","unresolved":0}],"unique_intervals":16777216,"verifier_sha256":"0e5cac77e57fdfa57a914093e28e7ed43bf2e9eb23b39dabc1e2c67d8ac25d83"}
package/index.d.ts CHANGED
@@ -82,6 +82,7 @@ export type ProgramUpdateOperation = "updateObserved" | "updateUnknown";
82
82
  export type ProgramError = Error & (
83
83
  | Readonly<{ code: ProgramCompileErrorCode; operation: "compileProgramWire" }>
84
84
  | Readonly<{ code: ProgramUpdateErrorCode; operation: ProgramUpdateOperation }>
85
+ | Readonly<{ code: "program_resource_exhausted"; operation: "copyOutputTable" }>
85
86
  | Readonly<{ code: ProgramAttachmentErrorCode; operation: "attachProgramWire" }>
86
87
  | Readonly<{
87
88
  code: ProgramAttachmentUpdateErrorCode;
package/index.js CHANGED
@@ -402,6 +402,7 @@ export function isProgramError(error) {
402
402
  if (operation === "updateObserved" || operation === "updateUnknown") {
403
403
  return UPDATE_PROGRAM_ERROR_CODES.has(code);
404
404
  }
405
+ if (operation === "copyOutputTable") return code === "program_resource_exhausted";
405
406
  if (operation === "attachProgramWire") return ATTACHMENT_ERROR_CODES.has(code);
406
407
  if (operation === "attachmentUpdateObserved" || operation === "attachmentUpdateUnknown") {
407
408
  return ATTACHMENT_UPDATE_ERROR_CODES.has(code);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@labpics/colors",
3
- "version": "1.0.3",
3
+ "version": "1.1.0",
4
4
  "packageManager": "npm@11.9.0",
5
5
  "description": "Библиотека адаптивных цветов для интерфейсов и дизайн-систем.",
6
6
  "type": "module",
@@ -101,6 +101,11 @@ export class ProgramAttachedSnapshot {
101
101
  private constructor();
102
102
  free(): void;
103
103
  [Symbol.dispose](): void;
104
+ /**
105
+ * Независимая JS-копия outputs: строки `[slot, red, green, blue, opacity]`
106
+ * в порядке поштучных геттеров. Состояние snapshot не меняется.
107
+ */
108
+ copyOutputTable(): Float64Array;
104
109
  hasRender(): boolean;
105
110
  outputCount(): number;
106
111
  outputOpacity(index: number): number;
@@ -158,6 +163,11 @@ export class ProgramSnapshot {
158
163
  private constructor();
159
164
  free(): void;
160
165
  [Symbol.dispose](): void;
166
+ /**
167
+ * Независимая JS-копия outputs: строки `[slot, red, green, blue, opacity]`
168
+ * в порядке поштучных геттеров. Состояние snapshot не меняется.
169
+ */
170
+ copyOutputTable(): Float64Array;
161
171
  outputCount(): number;
162
172
  outputOpacity(index: number): number;
163
173
  outputRgb(index: number): Uint8Array;
@@ -230,19 +240,13 @@ export interface InitOutput {
230
240
  readonly evaluateWcag22: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
231
241
  readonly issueSourceCertificateEnvelope: (a: number) => void;
232
242
  readonly numericalCapabilityManifest: (a: number) => void;
233
- readonly programattachedrender_bindingEpoch: (a: number) => bigint;
234
243
  readonly programattachedrender_contentIdentity: (a: number, b: number) => void;
235
244
  readonly programattachedrender_contextIdentity: (a: number, b: number) => void;
236
245
  readonly programattachedrender_occurrence: (a: number) => number;
237
- readonly programattachedrender_outputOpacity: (a: number) => number;
238
246
  readonly programattachedrender_outputRgb: (a: number, b: number) => void;
239
- readonly programattachedrender_outputSlot: (a: number) => number;
240
247
  readonly programattachedrender_physicalIdentity: (a: number, b: number) => void;
241
- readonly programattachedrender_presentationRoot: (a: number) => number;
242
- readonly programattachedrender_revision: (a: number) => bigint;
243
- readonly programattachedrender_sinkOutput: (a: number) => number;
244
- readonly programattachedrender_sinkSequence: (a: number) => bigint;
245
248
  readonly programattachedrender_terminalCompositeRgb: (a: number, b: number) => void;
249
+ readonly programattachedsnapshot_copyOutputTable: (a: number, b: number) => void;
246
250
  readonly programattachedsnapshot_hasRender: (a: number) => number;
247
251
  readonly programattachedsnapshot_outputCount: (a: number) => number;
248
252
  readonly programattachedsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
@@ -257,11 +261,19 @@ export interface InitOutput {
257
261
  readonly programattachment_updateUnknown: (a: number, b: number, c: number, d: number) => void;
258
262
  readonly programruntime_updateObserved: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
259
263
  readonly programruntime_updateUnknown: (a: number, b: number, c: number, d: number) => void;
260
- readonly programsnapshot_outputCount: (a: number) => number;
264
+ readonly programsnapshot_copyOutputTable: (a: number, b: number) => void;
261
265
  readonly programsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
262
266
  readonly programsnapshot_outputRgb: (a: number, b: number, c: number) => void;
263
267
  readonly programsnapshot_outputSlot: (a: number, b: number, c: number) => void;
264
268
  readonly programsnapshot_state: (a: number, b: number) => void;
269
+ readonly programsnapshot_outputCount: (a: number) => number;
270
+ readonly programattachedrender_bindingEpoch: (a: number) => bigint;
271
+ readonly programattachedrender_outputOpacity: (a: number) => number;
272
+ readonly programattachedrender_outputSlot: (a: number) => number;
273
+ readonly programattachedrender_presentationRoot: (a: number) => number;
274
+ readonly programattachedrender_revision: (a: number) => bigint;
275
+ readonly programattachedrender_sinkOutput: (a: number) => number;
276
+ readonly programattachedrender_sinkSequence: (a: number) => bigint;
265
277
  readonly __wbindgen_export: (a: number) => void;
266
278
  readonly __wbindgen_add_to_stack_pointer: (a: number) => number;
267
279
  readonly __wbindgen_export2: (a: number, b: number) => number;
package/pkg/labcolors.js CHANGED
@@ -1,5 +1,5 @@
1
1
  /* @ts-self-types="./labcolors.d.ts" */
2
- import { bindingFailure, certificateError, certificateProjection, copyOutputRgb, programError, programFailure } from './snippets/labcolors-wasm-9fb8b927594c3d6f/inline0.js';
2
+ import { bindingFailure, certificateError, certificateProjection, copyOutputRgb, copyOutputTable, programError, programFailure } from './snippets/labcolors-wasm-9fb8b927594c3d6f/inline0.js';
3
3
 
4
4
 
5
5
  export class AttachedMaterializationAuthority {
@@ -352,6 +352,26 @@ export class ProgramAttachedSnapshot {
352
352
  const ptr = this.__destroy_into_raw();
353
353
  wasm.__wbg_programattachedsnapshot_free(ptr, 0);
354
354
  }
355
+ /**
356
+ * Независимая JS-копия outputs: строки `[slot, red, green, blue, opacity]`
357
+ * в порядке поштучных геттеров. Состояние snapshot не меняется.
358
+ * @returns {Float64Array}
359
+ */
360
+ copyOutputTable() {
361
+ try {
362
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
363
+ wasm.programattachedsnapshot_copyOutputTable(retptr, this.__wbg_ptr);
364
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
365
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
366
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
367
+ if (r2) {
368
+ throw takeObject(r1);
369
+ }
370
+ return takeObject(r0);
371
+ } finally {
372
+ wasm.__wbindgen_add_to_stack_pointer(16);
373
+ }
374
+ }
355
375
  /**
356
376
  * @returns {boolean}
357
377
  */
@@ -674,6 +694,26 @@ export class ProgramSnapshot {
674
694
  const ptr = this.__destroy_into_raw();
675
695
  wasm.__wbg_programsnapshot_free(ptr, 0);
676
696
  }
697
+ /**
698
+ * Независимая JS-копия outputs: строки `[slot, red, green, blue, opacity]`
699
+ * в порядке поштучных геттеров. Состояние snapshot не меняется.
700
+ * @returns {Float64Array}
701
+ */
702
+ copyOutputTable() {
703
+ try {
704
+ const retptr = wasm.__wbindgen_add_to_stack_pointer(-16);
705
+ wasm.programsnapshot_copyOutputTable(retptr, this.__wbg_ptr);
706
+ var r0 = getDataViewMemory0().getInt32(retptr + 4 * 0, true);
707
+ var r1 = getDataViewMemory0().getInt32(retptr + 4 * 1, true);
708
+ var r2 = getDataViewMemory0().getInt32(retptr + 4 * 2, true);
709
+ if (r2) {
710
+ throw takeObject(r1);
711
+ }
712
+ return takeObject(r0);
713
+ } finally {
714
+ wasm.__wbindgen_add_to_stack_pointer(16);
715
+ }
716
+ }
677
717
  /**
678
718
  * @returns {number}
679
719
  */
@@ -959,6 +999,10 @@ function __wbg_get_imports() {
959
999
  const ret = copyOutputRgb(arg0, arg1, arg2);
960
1000
  return addHeapObject(ret);
961
1001
  }, arguments); },
1002
+ __wbg_copyOutputTable_00ec0bd65e911c91: function() { return handleError(function (arg0, arg1) {
1003
+ const ret = copyOutputTable(getArrayF64FromWasm0(arg0, arg1));
1004
+ return addHeapObject(ret);
1005
+ }, arguments); },
962
1006
  __wbg_new_da52cf8fe3429cb2: function() {
963
1007
  const ret = new Object();
964
1008
  return addHeapObject(ret);
@@ -1052,6 +1096,11 @@ function dropObject(idx) {
1052
1096
  heap_next = idx;
1053
1097
  }
1054
1098
 
1099
+ function getArrayF64FromWasm0(ptr, len) {
1100
+ ptr = ptr >>> 0;
1101
+ return getFloat64ArrayMemory0().subarray(ptr / 8, ptr / 8 + len);
1102
+ }
1103
+
1055
1104
  function getArrayU8FromWasm0(ptr, len) {
1056
1105
  ptr = ptr >>> 0;
1057
1106
  return getUint8ArrayMemory0().subarray(ptr / 1, ptr / 1 + len);
@@ -1065,6 +1114,14 @@ function getDataViewMemory0() {
1065
1114
  return cachedDataViewMemory0;
1066
1115
  }
1067
1116
 
1117
+ let cachedFloat64ArrayMemory0 = null;
1118
+ function getFloat64ArrayMemory0() {
1119
+ if (cachedFloat64ArrayMemory0 === null || cachedFloat64ArrayMemory0.byteLength === 0) {
1120
+ cachedFloat64ArrayMemory0 = new Float64Array(wasm.memory.buffer);
1121
+ }
1122
+ return cachedFloat64ArrayMemory0;
1123
+ }
1124
+
1068
1125
  function getStringFromWasm0(ptr, len) {
1069
1126
  return decodeText(ptr >>> 0, len);
1070
1127
  }
@@ -1198,6 +1255,7 @@ function __wbg_finalize_init(instance, module) {
1198
1255
  wasm = instance.exports;
1199
1256
  wasmModule = module;
1200
1257
  cachedDataViewMemory0 = null;
1258
+ cachedFloat64ArrayMemory0 = null;
1201
1259
  cachedUint32ArrayMemory0 = null;
1202
1260
  cachedUint8ArrayMemory0 = null;
1203
1261
  return wasm;
Binary file
@@ -26,19 +26,13 @@ export const decodeCertificateEnvelope: (a: number, b: number, c: number) => voi
26
26
  export const evaluateWcag22: (a: number, b: number, c: number, d: number, e: number, f: number, g: number) => void;
27
27
  export const issueSourceCertificateEnvelope: (a: number) => void;
28
28
  export const numericalCapabilityManifest: (a: number) => void;
29
- export const programattachedrender_bindingEpoch: (a: number) => bigint;
30
29
  export const programattachedrender_contentIdentity: (a: number, b: number) => void;
31
30
  export const programattachedrender_contextIdentity: (a: number, b: number) => void;
32
31
  export const programattachedrender_occurrence: (a: number) => number;
33
- export const programattachedrender_outputOpacity: (a: number) => number;
34
32
  export const programattachedrender_outputRgb: (a: number, b: number) => void;
35
- export const programattachedrender_outputSlot: (a: number) => number;
36
33
  export const programattachedrender_physicalIdentity: (a: number, b: number) => void;
37
- export const programattachedrender_presentationRoot: (a: number) => number;
38
- export const programattachedrender_revision: (a: number) => bigint;
39
- export const programattachedrender_sinkOutput: (a: number) => number;
40
- export const programattachedrender_sinkSequence: (a: number) => bigint;
41
34
  export const programattachedrender_terminalCompositeRgb: (a: number, b: number) => void;
35
+ export const programattachedsnapshot_copyOutputTable: (a: number, b: number) => void;
42
36
  export const programattachedsnapshot_hasRender: (a: number) => number;
43
37
  export const programattachedsnapshot_outputCount: (a: number) => number;
44
38
  export const programattachedsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
@@ -53,11 +47,19 @@ export const programattachment_updateObserved: (a: number, b: number, c: number,
53
47
  export const programattachment_updateUnknown: (a: number, b: number, c: number, d: number) => void;
54
48
  export const programruntime_updateObserved: (a: number, b: number, c: number, d: number, e: number, f: number, g: number, h: number) => void;
55
49
  export const programruntime_updateUnknown: (a: number, b: number, c: number, d: number) => void;
56
- export const programsnapshot_outputCount: (a: number) => number;
50
+ export const programsnapshot_copyOutputTable: (a: number, b: number) => void;
57
51
  export const programsnapshot_outputOpacity: (a: number, b: number, c: number) => void;
58
52
  export const programsnapshot_outputRgb: (a: number, b: number, c: number) => void;
59
53
  export const programsnapshot_outputSlot: (a: number, b: number, c: number) => void;
60
54
  export const programsnapshot_state: (a: number, b: number) => void;
55
+ export const programsnapshot_outputCount: (a: number) => number;
56
+ export const programattachedrender_bindingEpoch: (a: number) => bigint;
57
+ export const programattachedrender_outputOpacity: (a: number) => number;
58
+ export const programattachedrender_outputSlot: (a: number) => number;
59
+ export const programattachedrender_presentationRoot: (a: number) => number;
60
+ export const programattachedrender_revision: (a: number) => bigint;
61
+ export const programattachedrender_sinkOutput: (a: number) => number;
62
+ export const programattachedrender_sinkSequence: (a: number) => bigint;
61
63
  export const __wbindgen_export: (a: number) => void;
62
64
  export const __wbindgen_add_to_stack_pointer: (a: number) => number;
63
65
  export const __wbindgen_export2: (a: number, b: number) => number;
@@ -50,6 +50,7 @@ export function bindingFailure(kind, reason) {
50
50
  }
51
51
 
52
52
  const OutputRgbArray = Uint8Array;
53
+ const OutputTableArray = Float64Array;
53
54
 
54
55
  export function copyOutputRgb(red, green, blue) {
55
56
  const bytes = new OutputRgbArray(3);
@@ -59,6 +60,10 @@ export function copyOutputRgb(red, green, blue) {
59
60
  return bytes;
60
61
  }
61
62
 
63
+ export function copyOutputTable(values) {
64
+ return new OutputTableArray(values);
65
+ }
66
+
62
67
  export function certificateError(code, operation) {
63
68
  return programError(
64
69
  "Certificate envelope operation failed",