@chipmobilesdk/rn-theme 1.2.0 → 1.3.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 (257) hide show
  1. package/CHANGELOG.md +111 -0
  2. package/README.md +3 -1
  3. package/lib/commonjs/color/categorical.js +35 -0
  4. package/lib/commonjs/color/categorical.js.map +1 -0
  5. package/lib/commonjs/color/contrast.js +199 -0
  6. package/lib/commonjs/color/contrast.js.map +1 -0
  7. package/lib/commonjs/color/parse.js +110 -0
  8. package/lib/commonjs/color/parse.js.map +1 -0
  9. package/lib/commonjs/color/roles.js +235 -0
  10. package/lib/commonjs/color/roles.js.map +1 -0
  11. package/lib/commonjs/index.js +94 -0
  12. package/lib/commonjs/index.js.map +1 -0
  13. package/lib/commonjs/integration/navigationTheme.js +43 -0
  14. package/lib/commonjs/integration/navigationTheme.js.map +1 -0
  15. package/lib/commonjs/package.json +1 -0
  16. package/lib/commonjs/presets/byTone.js +28 -0
  17. package/lib/commonjs/presets/byTone.js.map +1 -0
  18. package/lib/commonjs/presets/layout.js +67 -0
  19. package/lib/commonjs/presets/layout.js.map +1 -0
  20. package/lib/commonjs/presets/themePresets.js +115 -0
  21. package/lib/commonjs/presets/themePresets.js.map +1 -0
  22. package/lib/commonjs/theme/buildThemes.js +211 -0
  23. package/lib/commonjs/theme/buildThemes.js.map +1 -0
  24. package/lib/commonjs/theme/errors.js +49 -0
  25. package/lib/commonjs/theme/errors.js.map +1 -0
  26. package/lib/commonjs/theme/overrides.js +125 -0
  27. package/lib/commonjs/theme/overrides.js.map +1 -0
  28. package/lib/commonjs/theme/validateThemeConfig.js +157 -0
  29. package/lib/commonjs/theme/validateThemeConfig.js.map +1 -0
  30. package/lib/commonjs/tokens/defaults.js +132 -0
  31. package/lib/commonjs/tokens/defaults.js.map +1 -0
  32. package/lib/commonjs/tokens/typography.js +136 -0
  33. package/lib/commonjs/tokens/typography.js.map +1 -0
  34. package/lib/commonjs/types/brand.js +2 -0
  35. package/lib/commonjs/types/brand.js.map +1 -0
  36. package/lib/commonjs/types/colors.js +2 -0
  37. package/lib/commonjs/types/colors.js.map +1 -0
  38. package/lib/commonjs/types/index.js +2 -0
  39. package/lib/commonjs/types/index.js.map +1 -0
  40. package/lib/commonjs/types/theme.js +6 -0
  41. package/lib/commonjs/types/theme.js.map +1 -0
  42. package/lib/commonjs/types/tokens.js +2 -0
  43. package/lib/commonjs/types/tokens.js.map +1 -0
  44. package/lib/commonjs/types/typography.js +2 -0
  45. package/lib/commonjs/types/typography.js.map +1 -0
  46. package/lib/commonjs/unistyles/createUnistylesConfig.js +113 -0
  47. package/lib/commonjs/unistyles/createUnistylesConfig.js.map +1 -0
  48. package/lib/commonjs/unistyles/themeMode.js +39 -0
  49. package/lib/commonjs/unistyles/themeMode.js.map +1 -0
  50. package/lib/commonjs/vendor/mcu/LICENSE +191 -0
  51. package/lib/commonjs/vendor/mcu/hct/cam16.js +362 -0
  52. package/lib/commonjs/vendor/mcu/hct/cam16.js.map +1 -0
  53. package/lib/commonjs/vendor/mcu/hct/hct.js +183 -0
  54. package/lib/commonjs/vendor/mcu/hct/hct.js.map +1 -0
  55. package/lib/commonjs/vendor/mcu/hct/hct_solver.js +401 -0
  56. package/lib/commonjs/vendor/mcu/hct/hct_solver.js.map +1 -0
  57. package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js +116 -0
  58. package/lib/commonjs/vendor/mcu/hct/viewing_conditions.js.map +1 -0
  59. package/lib/commonjs/vendor/mcu/index.js +27 -0
  60. package/lib/commonjs/vendor/mcu/index.js.map +1 -0
  61. package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js +177 -0
  62. package/lib/commonjs/vendor/mcu/palettes/tonal_palette.js.map +1 -0
  63. package/lib/commonjs/vendor/mcu/utils/color_utils.js +298 -0
  64. package/lib/commonjs/vendor/mcu/utils/color_utils.js.map +1 -0
  65. package/lib/commonjs/vendor/mcu/utils/math_utils.js +158 -0
  66. package/lib/commonjs/vendor/mcu/utils/math_utils.js.map +1 -0
  67. package/lib/module/color/categorical.js +31 -0
  68. package/lib/module/color/categorical.js.map +1 -0
  69. package/lib/module/color/contrast.js +194 -0
  70. package/lib/module/color/contrast.js.map +1 -0
  71. package/lib/module/color/parse.js +101 -0
  72. package/lib/module/color/parse.js.map +1 -0
  73. package/lib/module/color/roles.js +229 -0
  74. package/lib/module/color/roles.js.map +1 -0
  75. package/lib/module/index.js +23 -0
  76. package/lib/module/index.js.map +1 -0
  77. package/lib/module/integration/navigationTheme.js +39 -0
  78. package/lib/module/integration/navigationTheme.js.map +1 -0
  79. package/lib/module/package.json +1 -0
  80. package/lib/module/presets/byTone.js +24 -0
  81. package/lib/module/presets/byTone.js.map +1 -0
  82. package/lib/module/presets/layout.js +63 -0
  83. package/lib/module/presets/layout.js.map +1 -0
  84. package/lib/module/presets/themePresets.js +110 -0
  85. package/lib/module/presets/themePresets.js.map +1 -0
  86. package/lib/module/theme/buildThemes.js +208 -0
  87. package/lib/module/theme/buildThemes.js.map +1 -0
  88. package/lib/module/theme/errors.js +43 -0
  89. package/lib/module/theme/errors.js.map +1 -0
  90. package/lib/module/theme/overrides.js +119 -0
  91. package/lib/module/theme/overrides.js.map +1 -0
  92. package/lib/module/theme/validateThemeConfig.js +152 -0
  93. package/lib/module/theme/validateThemeConfig.js.map +1 -0
  94. package/lib/module/tokens/defaults.js +120 -0
  95. package/lib/module/tokens/defaults.js.map +1 -0
  96. package/lib/module/tokens/typography.js +129 -0
  97. package/lib/module/tokens/typography.js.map +1 -0
  98. package/lib/module/types/brand.js +2 -0
  99. package/lib/module/types/brand.js.map +1 -0
  100. package/lib/module/types/colors.js +2 -0
  101. package/lib/module/types/colors.js.map +1 -0
  102. package/lib/module/types/index.js +2 -0
  103. package/lib/module/types/index.js.map +1 -0
  104. package/lib/module/types/theme.js +4 -0
  105. package/lib/module/types/theme.js.map +1 -0
  106. package/lib/module/types/tokens.js +2 -0
  107. package/lib/module/types/tokens.js.map +1 -0
  108. package/lib/module/types/typography.js +2 -0
  109. package/lib/module/types/typography.js.map +1 -0
  110. package/lib/module/unistyles/createUnistylesConfig.js +109 -0
  111. package/lib/module/unistyles/createUnistylesConfig.js.map +1 -0
  112. package/lib/module/unistyles/themeMode.js +36 -0
  113. package/lib/module/unistyles/themeMode.js.map +1 -0
  114. package/lib/module/vendor/mcu/LICENSE +191 -0
  115. package/lib/module/vendor/mcu/hct/cam16.js +356 -0
  116. package/lib/module/vendor/mcu/hct/cam16.js.map +1 -0
  117. package/lib/module/vendor/mcu/hct/hct.js +178 -0
  118. package/lib/module/vendor/mcu/hct/hct.js.map +1 -0
  119. package/lib/module/vendor/mcu/hct/hct_solver.js +396 -0
  120. package/lib/module/vendor/mcu/hct/hct_solver.js.map +1 -0
  121. package/lib/module/vendor/mcu/hct/viewing_conditions.js +110 -0
  122. package/lib/module/vendor/mcu/hct/viewing_conditions.js.map +1 -0
  123. package/lib/module/vendor/mcu/index.js +8 -0
  124. package/lib/module/vendor/mcu/index.js.map +1 -0
  125. package/lib/module/vendor/mcu/palettes/tonal_palette.js +172 -0
  126. package/lib/module/vendor/mcu/palettes/tonal_palette.js.map +1 -0
  127. package/lib/module/vendor/mcu/utils/color_utils.js +277 -0
  128. package/lib/module/vendor/mcu/utils/color_utils.js.map +1 -0
  129. package/lib/module/vendor/mcu/utils/math_utils.js +146 -0
  130. package/lib/module/vendor/mcu/utils/math_utils.js.map +1 -0
  131. package/lib/typescript/commonjs/color/categorical.d.ts +7 -0
  132. package/lib/typescript/commonjs/color/categorical.d.ts.map +1 -0
  133. package/lib/typescript/commonjs/color/contrast.d.ts +26 -0
  134. package/lib/typescript/commonjs/color/contrast.d.ts.map +1 -0
  135. package/lib/typescript/commonjs/color/parse.d.ts +25 -0
  136. package/lib/typescript/commonjs/color/parse.d.ts.map +1 -0
  137. package/lib/typescript/commonjs/color/roles.d.ts +26 -0
  138. package/lib/typescript/commonjs/color/roles.d.ts.map +1 -0
  139. package/lib/typescript/commonjs/index.d.ts +18 -0
  140. package/lib/typescript/commonjs/index.d.ts.map +1 -0
  141. package/lib/typescript/commonjs/integration/navigationTheme.d.ts +30 -0
  142. package/lib/typescript/commonjs/integration/navigationTheme.d.ts.map +1 -0
  143. package/lib/typescript/commonjs/package.json +1 -0
  144. package/lib/typescript/commonjs/presets/byTone.d.ts +19 -0
  145. package/lib/typescript/commonjs/presets/byTone.d.ts.map +1 -0
  146. package/lib/typescript/commonjs/presets/layout.d.ts +63 -0
  147. package/lib/typescript/commonjs/presets/layout.d.ts.map +1 -0
  148. package/lib/typescript/commonjs/presets/themePresets.d.ts +11 -0
  149. package/lib/typescript/commonjs/presets/themePresets.d.ts.map +1 -0
  150. package/lib/typescript/commonjs/theme/buildThemes.d.ts +18 -0
  151. package/lib/typescript/commonjs/theme/buildThemes.d.ts.map +1 -0
  152. package/lib/typescript/commonjs/theme/errors.d.ts +23 -0
  153. package/lib/typescript/commonjs/theme/errors.d.ts.map +1 -0
  154. package/lib/typescript/commonjs/theme/overrides.d.ts +11 -0
  155. package/lib/typescript/commonjs/theme/overrides.d.ts.map +1 -0
  156. package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts +6 -0
  157. package/lib/typescript/commonjs/theme/validateThemeConfig.d.ts.map +1 -0
  158. package/lib/typescript/commonjs/tokens/defaults.d.ts +23 -0
  159. package/lib/typescript/commonjs/tokens/defaults.d.ts.map +1 -0
  160. package/lib/typescript/commonjs/tokens/typography.d.ts +14 -0
  161. package/lib/typescript/commonjs/tokens/typography.d.ts.map +1 -0
  162. package/lib/typescript/commonjs/types/brand.d.ts +21 -0
  163. package/lib/typescript/commonjs/types/brand.d.ts.map +1 -0
  164. package/lib/typescript/commonjs/types/colors.d.ts +76 -0
  165. package/lib/typescript/commonjs/types/colors.d.ts.map +1 -0
  166. package/lib/typescript/commonjs/types/index.d.ts +6 -0
  167. package/lib/typescript/commonjs/types/index.d.ts.map +1 -0
  168. package/lib/typescript/commonjs/types/theme.d.ts +140 -0
  169. package/lib/typescript/commonjs/types/theme.d.ts.map +1 -0
  170. package/lib/typescript/commonjs/types/tokens.d.ts +79 -0
  171. package/lib/typescript/commonjs/types/tokens.d.ts.map +1 -0
  172. package/lib/typescript/commonjs/types/typography.d.ts +53 -0
  173. package/lib/typescript/commonjs/types/typography.d.ts.map +1 -0
  174. package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts +52 -0
  175. package/lib/typescript/commonjs/unistyles/createUnistylesConfig.d.ts.map +1 -0
  176. package/lib/typescript/commonjs/unistyles/themeMode.d.ts +13 -0
  177. package/lib/typescript/commonjs/unistyles/themeMode.d.ts.map +1 -0
  178. package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts +132 -0
  179. package/lib/typescript/commonjs/vendor/mcu/hct/cam16.d.ts.map +1 -0
  180. package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts +93 -0
  181. package/lib/typescript/commonjs/vendor/mcu/hct/hct.d.ts.map +1 -0
  182. package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts +147 -0
  183. package/lib/typescript/commonjs/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
  184. package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
  185. package/lib/typescript/commonjs/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
  186. package/lib/typescript/commonjs/vendor/mcu/index.d.ts +4 -0
  187. package/lib/typescript/commonjs/vendor/mcu/index.d.ts.map +1 -0
  188. package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
  189. package/lib/typescript/commonjs/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
  190. package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts +129 -0
  191. package/lib/typescript/commonjs/vendor/mcu/utils/color_utils.d.ts.map +1 -0
  192. package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts +83 -0
  193. package/lib/typescript/commonjs/vendor/mcu/utils/math_utils.d.ts.map +1 -0
  194. package/lib/typescript/module/color/categorical.d.ts +7 -0
  195. package/lib/typescript/module/color/categorical.d.ts.map +1 -0
  196. package/lib/typescript/module/color/contrast.d.ts +26 -0
  197. package/lib/typescript/module/color/contrast.d.ts.map +1 -0
  198. package/lib/typescript/module/color/parse.d.ts +25 -0
  199. package/lib/typescript/module/color/parse.d.ts.map +1 -0
  200. package/lib/typescript/module/color/roles.d.ts +26 -0
  201. package/lib/typescript/module/color/roles.d.ts.map +1 -0
  202. package/lib/typescript/module/index.d.ts +18 -0
  203. package/lib/typescript/module/index.d.ts.map +1 -0
  204. package/lib/typescript/module/integration/navigationTheme.d.ts +30 -0
  205. package/lib/typescript/module/integration/navigationTheme.d.ts.map +1 -0
  206. package/lib/typescript/module/package.json +1 -0
  207. package/lib/typescript/module/presets/byTone.d.ts +19 -0
  208. package/lib/typescript/module/presets/byTone.d.ts.map +1 -0
  209. package/lib/typescript/module/presets/layout.d.ts +63 -0
  210. package/lib/typescript/module/presets/layout.d.ts.map +1 -0
  211. package/lib/typescript/module/presets/themePresets.d.ts +11 -0
  212. package/lib/typescript/module/presets/themePresets.d.ts.map +1 -0
  213. package/lib/typescript/module/theme/buildThemes.d.ts +18 -0
  214. package/lib/typescript/module/theme/buildThemes.d.ts.map +1 -0
  215. package/lib/typescript/module/theme/errors.d.ts +23 -0
  216. package/lib/typescript/module/theme/errors.d.ts.map +1 -0
  217. package/lib/typescript/module/theme/overrides.d.ts +11 -0
  218. package/lib/typescript/module/theme/overrides.d.ts.map +1 -0
  219. package/lib/typescript/module/theme/validateThemeConfig.d.ts +6 -0
  220. package/lib/typescript/module/theme/validateThemeConfig.d.ts.map +1 -0
  221. package/lib/typescript/module/tokens/defaults.d.ts +23 -0
  222. package/lib/typescript/module/tokens/defaults.d.ts.map +1 -0
  223. package/lib/typescript/module/tokens/typography.d.ts +14 -0
  224. package/lib/typescript/module/tokens/typography.d.ts.map +1 -0
  225. package/lib/typescript/module/types/brand.d.ts +21 -0
  226. package/lib/typescript/module/types/brand.d.ts.map +1 -0
  227. package/lib/typescript/module/types/colors.d.ts +76 -0
  228. package/lib/typescript/module/types/colors.d.ts.map +1 -0
  229. package/lib/typescript/module/types/index.d.ts +6 -0
  230. package/lib/typescript/module/types/index.d.ts.map +1 -0
  231. package/lib/typescript/module/types/theme.d.ts +140 -0
  232. package/lib/typescript/module/types/theme.d.ts.map +1 -0
  233. package/lib/typescript/module/types/tokens.d.ts +79 -0
  234. package/lib/typescript/module/types/tokens.d.ts.map +1 -0
  235. package/lib/typescript/module/types/typography.d.ts +53 -0
  236. package/lib/typescript/module/types/typography.d.ts.map +1 -0
  237. package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts +52 -0
  238. package/lib/typescript/module/unistyles/createUnistylesConfig.d.ts.map +1 -0
  239. package/lib/typescript/module/unistyles/themeMode.d.ts +13 -0
  240. package/lib/typescript/module/unistyles/themeMode.d.ts.map +1 -0
  241. package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts +132 -0
  242. package/lib/typescript/module/vendor/mcu/hct/cam16.d.ts.map +1 -0
  243. package/lib/typescript/module/vendor/mcu/hct/hct.d.ts +93 -0
  244. package/lib/typescript/module/vendor/mcu/hct/hct.d.ts.map +1 -0
  245. package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts +147 -0
  246. package/lib/typescript/module/vendor/mcu/hct/hct_solver.d.ts.map +1 -0
  247. package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts +75 -0
  248. package/lib/typescript/module/vendor/mcu/hct/viewing_conditions.d.ts.map +1 -0
  249. package/lib/typescript/module/vendor/mcu/index.d.ts +4 -0
  250. package/lib/typescript/module/vendor/mcu/index.d.ts.map +1 -0
  251. package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts +56 -0
  252. package/lib/typescript/module/vendor/mcu/palettes/tonal_palette.d.ts.map +1 -0
  253. package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts +129 -0
  254. package/lib/typescript/module/vendor/mcu/utils/color_utils.d.ts.map +1 -0
  255. package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts +83 -0
  256. package/lib/typescript/module/vendor/mcu/utils/math_utils.d.ts.map +1 -0
  257. package/package.json +40 -16
@@ -0,0 +1,110 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2021 Google LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+
20
+ // Vendored from material-foundation/material-color-utilities v0.4.0
21
+ // (commit dd62982dfdefdfc9232ce8d76e122fb1c6d188ae, typescript/). Modified:
22
+ // relative import specifiers drop the `.js` suffix so Metro and Jest resolve them.
23
+ import * as utils from "../utils/color_utils.js";
24
+ import * as math from "../utils/math_utils.js";
25
+
26
+ /**
27
+ * In traditional color spaces, a color can be identified solely by the
28
+ * observer's measurement of the color. Color appearance models such as CAM16
29
+ * also use information about the environment where the color was
30
+ * observed, known as the viewing conditions.
31
+ *
32
+ * For example, white under the traditional assumption of a midday sun white
33
+ * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
34
+ * hue 203, chroma 3, lightness 100)
35
+ *
36
+ * This class caches intermediate values of the CAM16 conversion process that
37
+ * depend only on viewing conditions, enabling speed ups.
38
+ */
39
+ export class ViewingConditions {
40
+ /** sRGB-like viewing conditions. */
41
+ static DEFAULT = ViewingConditions.make();
42
+
43
+ /**
44
+ * Create ViewingConditions from a simple, physically relevant, set of
45
+ * parameters.
46
+ *
47
+ * @param whitePoint White point, measured in the XYZ color space.
48
+ * default = D65, or sunny day afternoon
49
+ * @param adaptingLuminance The luminance of the adapting field. Informally,
50
+ * how bright it is in the room where the color is viewed. Can be
51
+ * calculated from lux by multiplying lux by 0.0586. default = 11.72,
52
+ * or 200 lux.
53
+ * @param backgroundLstar The lightness of the area surrounding the color.
54
+ * measured by L* in L*a*b*. default = 50.0
55
+ * @param surround A general description of the lighting surrounding the
56
+ * color. 0 is pitch dark, like watching a movie in a theater. 1.0 is a
57
+ * dimly light room, like watching TV at home at night. 2.0 means there
58
+ * is no difference between the lighting on the color and around it.
59
+ * default = 2.0
60
+ * @param discountingIlluminant Whether the eye accounts for the tint of the
61
+ * ambient lighting, such as knowing an apple is still red in green light.
62
+ * default = false, the eye does not perform this process on
63
+ * self-luminous objects like displays.
64
+ */
65
+ static make(whitePoint = utils.whitePointD65(), adaptingLuminance = 200.0 / Math.PI * utils.yFromLstar(50.0) / 100.0, backgroundLstar = 50.0, surround = 2.0, discountingIlluminant = false) {
66
+ const xyz = whitePoint;
67
+ const rW = xyz[0] * 0.401288 + xyz[1] * 0.650173 + xyz[2] * -0.051461;
68
+ const gW = xyz[0] * -0.250268 + xyz[1] * 1.204414 + xyz[2] * 0.045854;
69
+ const bW = xyz[0] * -0.002079 + xyz[1] * 0.048952 + xyz[2] * 0.953127;
70
+ const f = 0.8 + surround / 10.0;
71
+ const c = f >= 0.9 ? math.lerp(0.59, 0.69, (f - 0.9) * 10.0) : math.lerp(0.525, 0.59, (f - 0.8) * 10.0);
72
+ let d = discountingIlluminant ? 1.0 : f * (1.0 - 1.0 / 3.6 * Math.exp((-adaptingLuminance - 42.0) / 92.0));
73
+ d = d > 1.0 ? 1.0 : d < 0.0 ? 0.0 : d;
74
+ const nc = f;
75
+ const rgbD = [d * (100.0 / rW) + 1.0 - d, d * (100.0 / gW) + 1.0 - d, d * (100.0 / bW) + 1.0 - d];
76
+ const k = 1.0 / (5.0 * adaptingLuminance + 1.0);
77
+ const k4 = k * k * k * k;
78
+ const k4F = 1.0 - k4;
79
+ const fl = k4 * adaptingLuminance + 0.1 * k4F * k4F * Math.cbrt(5.0 * adaptingLuminance);
80
+ const n = utils.yFromLstar(backgroundLstar) / whitePoint[1];
81
+ const z = 1.48 + Math.sqrt(n);
82
+ const nbb = 0.725 / Math.pow(n, 0.2);
83
+ const ncb = nbb;
84
+ const rgbAFactors = [Math.pow(fl * rgbD[0] * rW / 100.0, 0.42), Math.pow(fl * rgbD[1] * gW / 100.0, 0.42), Math.pow(fl * rgbD[2] * bW / 100.0, 0.42)];
85
+ const rgbA = [400.0 * rgbAFactors[0] / (rgbAFactors[0] + 27.13), 400.0 * rgbAFactors[1] / (rgbAFactors[1] + 27.13), 400.0 * rgbAFactors[2] / (rgbAFactors[2] + 27.13)];
86
+ const aw = (2.0 * rgbA[0] + rgbA[1] + 0.05 * rgbA[2]) * nbb;
87
+ return new ViewingConditions(n, aw, nbb, ncb, c, nc, rgbD, fl, Math.pow(fl, 0.25), z);
88
+ }
89
+
90
+ /**
91
+ * Parameters are intermediate values of the CAM16 conversion process. Their
92
+ * names are shorthand for technical color science terminology, this class
93
+ * would not benefit from documenting them individually. A brief overview
94
+ * is available in the CAM16 specification, and a complete overview requires
95
+ * a color science textbook, such as Fairchild's Color Appearance Models.
96
+ */
97
+ constructor(n, aw, nbb, ncb, c, nc, rgbD, fl, fLRoot, z) {
98
+ this.n = n;
99
+ this.aw = aw;
100
+ this.nbb = nbb;
101
+ this.ncb = ncb;
102
+ this.c = c;
103
+ this.nc = nc;
104
+ this.rgbD = rgbD;
105
+ this.fl = fl;
106
+ this.fLRoot = fLRoot;
107
+ this.z = z;
108
+ }
109
+ }
110
+ //# sourceMappingURL=viewing_conditions.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["utils","math","ViewingConditions","DEFAULT","make","whitePoint","whitePointD65","adaptingLuminance","Math","PI","yFromLstar","backgroundLstar","surround","discountingIlluminant","xyz","rW","gW","bW","f","c","lerp","d","exp","nc","rgbD","k","k4","k4F","fl","cbrt","n","z","sqrt","nbb","pow","ncb","rgbAFactors","rgbA","aw","constructor","fLRoot"],"sourceRoot":"../../../../../src","sources":["vendor/mcu/hct/viewing_conditions.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA,OAAO,KAAKA,KAAK,MAAM,yBAAsB;AAC7C,OAAO,KAAKC,IAAI,MAAM,wBAAqB;;AAE3C;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,OAAO,MAAMC,iBAAiB,CAAC;EAC7B;EACA,OAAOC,OAAO,GAAGD,iBAAiB,CAACE,IAAI,CAAC,CAAC;;EAEzC;AACF;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;EACE,OAAOA,IAAIA,CACPC,UAAU,GAAGL,KAAK,CAACM,aAAa,CAAC,CAAC,EAClCC,iBAAiB,GAAI,KAAK,GAAGC,IAAI,CAACC,EAAE,GAAIT,KAAK,CAACU,UAAU,CAAC,IAAI,CAAC,GAAG,KAAK,EACtEC,eAAe,GAAG,IAAI,EAAEC,QAAQ,GAAG,GAAG,EACtCC,qBAAqB,GAAG,KAAK,EAAqB;IACpD,MAAMC,GAAG,GAAGT,UAAU;IACtB,MAAMU,EAAE,GAAGD,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ;IACrE,MAAME,EAAE,GAAGF,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ;IACrE,MAAMG,EAAE,GAAGH,GAAG,CAAC,CAAC,CAAC,GAAG,CAAC,QAAQ,GAAGA,GAAG,CAAC,CAAC,CAAC,GAAG,QAAQ,GAA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AEL,GAAG,EAAEE,GAAG,EAAEhB,CAAC,EAAEI,EAAE,EAAEC,IAAI,EAAEI,EAAE,EAAEpB,IAAI,CAAC0B,GAAG,CAACN,EAAE,EAAE,IAAI,CAAC,EAAEG,CAAC,CAAC;EAC9D;;EAEA;AACF;AACA;AACA;AACA;AACA;AACA;EACUQ,WAAWA,CACRT,CAAS,EAASQ,EAAU,EAASL,GAAW,EAChDE,GAAW,EAAShB,CAAS,EAASI,EAAU,EAChDC,IAAc,EAASI,EAAU,EAASY,MAAc,EACxDT,CAAS,EAAE;IAAA,KAHXD,CAAS,GAATA,CAAS;IAAA,KAASQ,EAAU,GAAVA,EAAU;IAAA,KAASL,GAAW,GAAXA,GAAW;IAAA,KAChDE,GAAW,GAAXA,GAAW;IAAA,KAAShB,CAAS,GAATA,CAAS;IAAA,KAASI,EAAU,GAAVA,EAAU;IAAA,KAChDC,IAAc,GAAdA,IAAc;IAAA,KAASI,EAAU,GAAVA,EAAU;IAAA,KAASY,MAAc,GAAdA,MAAc;IAAA,KACxDT,CAAS,GAATA,CAAS;EAAG;AACzB","ignoreList":[]}
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+
3
+ // Entry point for the vendored material-color-utilities subset. Package code
4
+ // imports from here only, so the vendored surface stays explicit.
5
+ export { Hct } from "./hct/hct.js";
6
+ export { TonalPalette } from "./palettes/tonal_palette.js";
7
+ export { argbFromRgb } from "./utils/color_utils.js";
8
+ //# sourceMappingURL=index.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Hct","TonalPalette","argbFromRgb"],"sourceRoot":"../../../../src","sources":["vendor/mcu/index.ts"],"mappings":";;AAAA;AACA;AACA,SAASA,GAAG,QAAQ,cAAW;AAC/B,SAASC,YAAY,QAAQ,6BAA0B;AACvD,SAASC,WAAW,QAAQ,wBAAqB","ignoreList":[]}
@@ -0,0 +1,172 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2021 Google LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+
20
+ // Vendored from material-foundation/material-color-utilities v0.4.0
21
+ // (commit dd62982dfdefdfc9232ce8d76e122fb1c6d188ae, typescript/). Modified:
22
+ // relative import specifiers drop the `.js` suffix so Metro and Jest resolve them.
23
+ import { Hct } from "../hct/hct.js";
24
+
25
+ /**
26
+ * A convenience class for retrieving colors that are constant in hue and
27
+ * chroma, but vary in tone.
28
+ */
29
+ export class TonalPalette {
30
+ cache = new Map();
31
+
32
+ /**
33
+ * @param argb ARGB representation of a color
34
+ * @return Tones matching that color's hue and chroma.
35
+ */
36
+ static fromInt(argb) {
37
+ const hct = Hct.fromInt(argb);
38
+ return TonalPalette.fromHct(hct);
39
+ }
40
+
41
+ /**
42
+ * @param hct Hct
43
+ * @return Tones matching that color's hue and chroma.
44
+ */
45
+ static fromHct(hct) {
46
+ return new TonalPalette(hct.hue, hct.chroma, hct);
47
+ }
48
+
49
+ /**
50
+ * @param hue HCT hue
51
+ * @param chroma HCT chroma
52
+ * @return Tones matching hue and chroma.
53
+ */
54
+ static fromHueAndChroma(hue, chroma) {
55
+ const keyColor = new KeyColor(hue, chroma).create();
56
+ return new TonalPalette(hue, chroma, keyColor);
57
+ }
58
+ constructor(hue, chroma, keyColor) {
59
+ this.hue = hue;
60
+ this.chroma = chroma;
61
+ this.keyColor = keyColor;
62
+ }
63
+
64
+ /**
65
+ * @param tone HCT tone, measured from 0 to 100.
66
+ * @return ARGB representation of a color with that tone.
67
+ */
68
+ tone(tone) {
69
+ let argb = this.cache.get(tone);
70
+ if (argb === undefined) {
71
+ if (tone == 99 && Hct.isYellow(this.hue)) {
72
+ argb = this.averageArgb(this.tone(98), this.tone(100));
73
+ } else {
74
+ argb = Hct.from(this.hue, this.chroma, tone).toInt();
75
+ }
76
+ this.cache.set(tone, argb);
77
+ }
78
+ return argb;
79
+ }
80
+
81
+ /**
82
+ * @param tone HCT tone.
83
+ * @return HCT representation of a color with that tone.
84
+ */
85
+ getHct(tone) {
86
+ return Hct.fromInt(this.tone(tone));
87
+ }
88
+ averageArgb(argb1, argb2) {
89
+ const red1 = argb1 >>> 16 & 0xff;
90
+ const green1 = argb1 >>> 8 & 0xff;
91
+ const blue1 = argb1 & 0xff;
92
+ const red2 = argb2 >>> 16 & 0xff;
93
+ const green2 = argb2 >>> 8 & 0xff;
94
+ const blue2 = argb2 & 0xff;
95
+ const red = Math.round((red1 + red2) / 2);
96
+ const green = Math.round((green1 + green2) / 2);
97
+ const blue = Math.round((blue1 + blue2) / 2);
98
+ return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
99
+ }
100
+ }
101
+
102
+ /**
103
+ * Key color is a color that represents the hue and chroma of a tonal palette
104
+ */
105
+ class KeyColor {
106
+ // Cache that maps tone to max chroma to avoid duplicated HCT calculation.
107
+ chromaCache = new Map();
108
+ maxChromaValue = 200.0;
109
+ constructor(hue, requestedChroma) {
110
+ this.hue = hue;
111
+ this.requestedChroma = requestedChroma;
112
+ }
113
+
114
+ /**
115
+ * Creates a key color from a [hue] and a [chroma].
116
+ * The key color is the first tone, starting from T50, matching the given hue
117
+ * and chroma.
118
+ *
119
+ * @return Key color [Hct]
120
+ */
121
+ create() {
122
+ // Pivot around T50 because T50 has the most chroma available, on
123
+ // average. Thus it is most likely to have a direct answer.
124
+ const pivotTone = 50;
125
+ const toneStepSize = 1;
126
+ // Epsilon to accept values slightly higher than the requested chroma.
127
+ const epsilon = 0.01;
128
+
129
+ // Binary search to find the tone that can provide a chroma that is closest
130
+ // to the requested chroma.
131
+ let lowerTone = 0;
132
+ let upperTone = 100;
133
+ while (lowerTone < upperTone) {
134
+ const midTone = Math.floor((lowerTone + upperTone) / 2);
135
+ const isAscending = this.maxChroma(midTone) < this.maxChroma(midTone + toneStepSize);
136
+ const sufficientChroma = this.maxChroma(midTone) >= this.requestedChroma - epsilon;
137
+ if (sufficientChroma) {
138
+ // Either range [lowerTone, midTone] or [midTone, upperTone] has
139
+ // the answer, so search in the range that is closer the pivot tone.
140
+ if (Math.abs(lowerTone - pivotTone) < Math.abs(upperTone - pivotTone)) {
141
+ upperTone = midTone;
142
+ } else {
143
+ if (lowerTone === midTone) {
144
+ return Hct.from(this.hue, this.requestedChroma, lowerTone);
145
+ }
146
+ lowerTone = midTone;
147
+ }
148
+ } else {
149
+ // As there is no sufficient chroma in the midTone, follow the direction
150
+ // to the chroma peak.
151
+ if (isAscending) {
152
+ lowerTone = midTone + toneStepSize;
153
+ } else {
154
+ // Keep midTone for potential chroma peak.
155
+ upperTone = midTone;
156
+ }
157
+ }
158
+ }
159
+ return Hct.from(this.hue, this.requestedChroma, lowerTone);
160
+ }
161
+
162
+ // Find the maximum chroma for a given tone
163
+ maxChroma(tone) {
164
+ if (this.chromaCache.has(tone)) {
165
+ return this.chromaCache.get(tone);
166
+ }
167
+ const chroma = Hct.from(this.hue, this.maxChromaValue, tone).chroma;
168
+ this.chromaCache.set(tone, chroma);
169
+ return chroma;
170
+ }
171
+ }
172
+ //# sourceMappingURL=tonal_palette.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["Hct","TonalPalette","cache","Map","fromInt","argb","hct","fromHct","hue","chroma","fromHueAndChroma","keyColor","KeyColor","create","constructor","tone","get","undefined","isYellow","averageArgb","from","toInt","set","getHct","argb1","argb2","red1","green1","blue1","red2","green2","blue2","red","Math","round","green","blue","chromaCache","maxChromaValue","requestedChroma","pivotTone","toneStepSize","epsilon","lowerTone","upperTone","midTone","floor","isAscending","maxChroma","sufficientChroma","abs","has"],"sourceRoot":"../../../../../src","sources":["vendor/mcu/palettes/t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AAO,EAAE;YACzB,OAAO7C,GAAG,CAACoB,IAAI,CAAC,IAAI,CAACZ,GAAG,EAAE,IAAI,CAAC+B,eAAe,EAAEI,SAAS,CAAC;UAC5D;UACAA,SAAS,GAAGE,OAAO;QACrB;MACF,CAAC,MAAM;QACL;QACA;QACA,IAAIE,WAAW,EAAE;UACfJ,SAAS,GAAGE,OAAO,GAAGJ,YAAY;QACpC,CAAC,MAAM;UACL;UACAG,SAAS,GAAGC,OAAO;QACrB;MACF;IACF;IAEA,OAAO7C,GAAG,CAACoB,IAAI,CAAC,IAAI,CAACZ,GAAG,EAAE,IAAI,CAAC+B,eAAe,EAAEI,SAAS,CAAC;EAC5D;;EAEA;EACQK,SAASA,CAACjC,IAAY,EAAU;IACtC,IAAI,IAAI,CAACsB,WAAW,CAACc,GAAG,CAACpC,IAAI,CAAC,EAAE;MAC9B,OAAO,IAAI,CAACsB,WAAW,CAACrB,GAAG,CAACD,IAAI,CAAC;IACnC;IACA,MAAMN,MAAM,GAAGT,GAAG,CAACoB,IAAI,CAAC,IAAI,CAACZ,GAAG,EAAE,IAAI,CAAC8B,cAAc,EAAEvB,IAAI,CAAC,CAACN,MAAM;IACnE,IAAI,CAAC4B,WAAW,CAACf,GAAG,CAACP,IAAI,EAAEN,MAAM,CAAC;IAClC,OAAOA,MAAM;EACf;AACF","ignoreList":[]}
@@ -0,0 +1,277 @@
1
+ "use strict";
2
+
3
+ /**
4
+ * @license
5
+ * Copyright 2021 Google LLC
6
+ *
7
+ * Licensed under the Apache License, Version 2.0 (the "License");
8
+ * you may not use this file except in compliance with the License.
9
+ * You may obtain a copy of the License at
10
+ *
11
+ * http://www.apache.org/licenses/LICENSE-2.0
12
+ *
13
+ * Unless required by applicable law or agreed to in writing, software
14
+ * distributed under the License is distributed on an "AS IS" BASIS,
15
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16
+ * See the License for the specific language governing permissions and
17
+ * limitations under the License.
18
+ */
19
+
20
+ // Vendored from material-foundation/material-color-utilities v0.4.0
21
+ // (commit dd62982dfdefdfc9232ce8d76e122fb1c6d188ae, typescript/). Modified:
22
+ // relative import specifiers drop the `.js` suffix so Metro and Jest resolve them.
23
+ // This file is automatically generated. Do not modify it.
24
+
25
+ import * as mathUtils from "./math_utils.js";
26
+
27
+ /**
28
+ * Color science utilities.
29
+ *
30
+ * Utility methods for color science constants and color space
31
+ * conversions that aren't HCT or CAM16.
32
+ */
33
+
34
+ const SRGB_TO_XYZ = [[0.41233895, 0.35762064, 0.18051042], [0.2126, 0.7152, 0.0722], [0.01932141, 0.11916382, 0.95034478]];
35
+ const XYZ_TO_SRGB = [[3.2413774792388685, -1.5376652402851851, -0.49885366846268053], [-0.9691452513005321, 1.8758853451067872, 0.04156585616912061], [0.05562093689691305, -0.20395524564742123, 1.0571799111220335]];
36
+ const WHITE_POINT_D65 = [95.047, 100.0, 108.883];
37
+
38
+ /**
39
+ * Converts a color from RGB components to ARGB format.
40
+ */
41
+ export function argbFromRgb(red, green, blue) {
42
+ return (255 << 24 | (red & 255) << 16 | (green & 255) << 8 | blue & 255) >>> 0;
43
+ }
44
+
45
+ /**
46
+ * Converts a color from linear RGB components to ARGB format.
47
+ */
48
+ export function argbFromLinrgb(linrgb) {
49
+ const r = delinearized(linrgb[0]);
50
+ const g = delinearized(linrgb[1]);
51
+ const b = delinearized(linrgb[2]);
52
+ return argbFromRgb(r, g, b);
53
+ }
54
+
55
+ /**
56
+ * Returns the alpha component of a color in ARGB format.
57
+ */
58
+ export function alphaFromArgb(argb) {
59
+ return argb >> 24 & 255;
60
+ }
61
+
62
+ /**
63
+ * Returns the red component of a color in ARGB format.
64
+ */
65
+ export function redFromArgb(argb) {
66
+ return argb >> 16 & 255;
67
+ }
68
+
69
+ /**
70
+ * Returns the green component of a color in ARGB format.
71
+ */
72
+ export function greenFromArgb(argb) {
73
+ return argb >> 8 & 255;
74
+ }
75
+
76
+ /**
77
+ * Returns the blue component of a color in ARGB format.
78
+ */
79
+ export function blueFromArgb(argb) {
80
+ return argb & 255;
81
+ }
82
+
83
+ /**
84
+ * Returns whether a color in ARGB format is opaque.
85
+ */
86
+ export function isOpaque(argb) {
87
+ return alphaFromArgb(argb) >= 255;
88
+ }
89
+
90
+ /**
91
+ * Converts a color from ARGB to XYZ.
92
+ */
93
+ export function argbFromXyz(x, y, z) {
94
+ const matrix = XYZ_TO_SRGB;
95
+ const linearR = matrix[0][0] * x + matrix[0][1] * y + matrix[0][2] * z;
96
+ const linearG = matrix[1][0] * x + matrix[1][1] * y + matrix[1][2] * z;
97
+ const linearB = matrix[2][0] * x + matrix[2][1] * y + matrix[2][2] * z;
98
+ const r = delinearized(linearR);
99
+ const g = delinearized(linearG);
100
+ const b = delinearized(linearB);
101
+ return argbFromRgb(r, g, b);
102
+ }
103
+
104
+ /**
105
+ * Converts a color from XYZ to ARGB.
106
+ */
107
+ export function xyzFromArgb(argb) {
108
+ const r = linearized(redFromArgb(argb));
109
+ const g = linearized(greenFromArgb(argb));
110
+ const b = linearized(blueFromArgb(argb));
111
+ return mathUtils.matrixMultiply([r, g, b], SRGB_TO_XYZ);
112
+ }
113
+
114
+ /**
115
+ * Converts a color represented in Lab color space into an ARGB
116
+ * integer.
117
+ */
118
+ export function argbFromLab(l, a, b) {
119
+ const whitePoint = WHITE_POINT_D65;
120
+ const fy = (l + 16.0) / 116.0;
121
+ const fx = a / 500.0 + fy;
122
+ const fz = fy - b / 200.0;
123
+ const xNormalized = labInvf(fx);
124
+ const yNormalized = labInvf(fy);
125
+ const zNormalized = labInvf(fz);
126
+ const x = xNormalized * whitePoint[0];
127
+ const y = yNormalized * whitePoint[1];
128
+ const z = zNormalized * whitePoint[2];
129
+ return argbFromXyz(x, y, z);
130
+ }
131
+
132
+ /**
133
+ * Converts a color from ARGB representation to L*a*b*
134
+ * representation.
135
+ *
136
+ * @param argb the ARGB representation of a color
137
+ * @return a Lab object representing the color
138
+ */
139
+ export function labFromArgb(argb) {
140
+ const linearR = linearized(redFromArgb(argb));
141
+ const linearG = linearized(greenFromArgb(argb));
142
+ const linearB = linearized(blueFromArgb(argb));
143
+ const matrix = SRGB_TO_XYZ;
144
+ const x = matrix[0][0] * linearR + matrix[0][1] * linearG + matrix[0][2] * linearB;
145
+ const y = matrix[1][0] * linearR + matrix[1][1] * linearG + matrix[1][2] * linearB;
146
+ const z = matrix[2][0] * linearR + matrix[2][1] * linearG + matrix[2][2] * linearB;
147
+ const whitePoint = WHITE_POINT_D65;
148
+ const xNormalized = x / whitePoint[0];
149
+ const yNormalized = y / whitePoint[1];
150
+ const zNormalized = z / whitePoint[2];
151
+ const fx = labF(xNormalized);
152
+ const fy = labF(yNormalized);
153
+ const fz = labF(zNormalized);
154
+ const l = 116.0 * fy - 16;
155
+ const a = 500.0 * (fx - fy);
156
+ const b = 200.0 * (fy - fz);
157
+ return [l, a, b];
158
+ }
159
+
160
+ /**
161
+ * Converts an L* value to an ARGB representation.
162
+ *
163
+ * @param lstar L* in L*a*b*
164
+ * @return ARGB representation of grayscale color with lightness
165
+ * matching L*
166
+ */
167
+ export function argbFromLstar(lstar) {
168
+ const y = yFromLstar(lstar);
169
+ const component = delinearized(y);
170
+ return argbFromRgb(component, component, component);
171
+ }
172
+
173
+ /**
174
+ * Computes the L* value of a color in ARGB representation.
175
+ *
176
+ * @param argb ARGB representation of a color
177
+ * @return L*, from L*a*b*, coordinate of the color
178
+ */
179
+ export function lstarFromArgb(argb) {
180
+ const y = xyzFromArgb(argb)[1];
181
+ return 116.0 * labF(y / 100.0) - 16.0;
182
+ }
183
+
184
+ /**
185
+ * Converts an L* value to a Y value.
186
+ *
187
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
188
+ *
189
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
190
+ * measures relative luminance, a logarithmic scale.
191
+ *
192
+ * @param lstar L* in L*a*b*
193
+ * @return Y in XYZ
194
+ */
195
+ export function yFromLstar(lstar) {
196
+ return 100.0 * labInvf((lstar + 16.0) / 116.0);
197
+ }
198
+
199
+ /**
200
+ * Converts a Y value to an L* value.
201
+ *
202
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
203
+ *
204
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
205
+ * measures relative luminance, a logarithmic scale.
206
+ *
207
+ * @param y Y in XYZ
208
+ * @return L* in L*a*b*
209
+ */
210
+ export function lstarFromY(y) {
211
+ return labF(y / 100.0) * 116.0 - 16.0;
212
+ }
213
+
214
+ /**
215
+ * Linearizes an RGB component.
216
+ *
217
+ * @param rgbComponent 0 <= rgb_component <= 255, represents R/G/B
218
+ * channel
219
+ * @return 0.0 <= output <= 100.0, color channel converted to
220
+ * linear RGB space
221
+ */
222
+ export function linearized(rgbComponent) {
223
+ const normalized = rgbComponent / 255.0;
224
+ if (normalized <= 0.040449936) {
225
+ return normalized / 12.92 * 100.0;
226
+ } else {
227
+ return Math.pow((normalized + 0.055) / 1.055, 2.4) * 100.0;
228
+ }
229
+ }
230
+
231
+ /**
232
+ * Delinearizes an RGB component.
233
+ *
234
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
235
+ * linear R/G/B channel
236
+ * @return 0 <= output <= 255, color channel converted to regular
237
+ * RGB space
238
+ */
239
+ export function delinearized(rgbComponent) {
240
+ const normalized = rgbComponent / 100.0;
241
+ let delinearized = 0.0;
242
+ if (normalized <= 0.0031308) {
243
+ delinearized = normalized * 12.92;
244
+ } else {
245
+ delinearized = 1.055 * Math.pow(normalized, 1.0 / 2.4) - 0.055;
246
+ }
247
+ return mathUtils.clampInt(0, 255, Math.round(delinearized * 255.0));
248
+ }
249
+
250
+ /**
251
+ * Returns the standard white point; white on a sunny day.
252
+ *
253
+ * @return The white point
254
+ */
255
+ export function whitePointD65() {
256
+ return WHITE_POINT_D65;
257
+ }
258
+ function labF(t) {
259
+ const e = 216.0 / 24389.0;
260
+ const kappa = 24389.0 / 27.0;
261
+ if (t > e) {
262
+ return Math.pow(t, 1.0 / 3.0);
263
+ } else {
264
+ return (kappa * t + 16) / 116;
265
+ }
266
+ }
267
+ function labInvf(ft) {
268
+ const e = 216.0 / 24389.0;
269
+ const kappa = 24389.0 / 27.0;
270
+ const ft3 = ft * ft * ft;
271
+ if (ft3 > e) {
272
+ return ft3;
273
+ } else {
274
+ return (116 * ft - 16) / kappa;
275
+ }
276
+ }
277
+ //# sourceMappingURL=color_utils.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"names":["mathUtils","SRGB_TO_XYZ","XYZ_TO_SRGB","WHITE_POINT_D65","argbFromRgb","red","green","blue","argbFromLinrgb","linrgb","r","delinearized","g","b","alphaFromArgb","argb","redFromArgb","greenFromArgb","blueFromArgb","isOpaque","argbFromXyz","x","y","z","matrix","linearR","linearG","linearB","xyzFromArgb","linearized","matrixMultiply","argbFromLab","l","a","whitePoint","fy","fx","fz","xNormalized","labInvf","yNormalized","zNormalized","labFromArgb","labF","argbFromLstar","lstar","yFromLstar","component","lstarFromArgb","lstarFromY","rgbComponent","normalized","Math","pow","clampInt","round","whitePointD65","t","e","kappa","ft","ft3"],"sourceRoot":"../../../../../src","sources":["vendor/mcu/utils/color_utils.ts"],"mappings":";;AAAA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;;AAEA;AACA;AACA;AACA;;AAEA,OAAO,KAAKA,SAAS,MAAM,iBAAc;;AAEzC;AACA;AACA;AACA;AACA;AACA;;AAEA,MAAMC,WAAW,GAAG,CAClB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,EACpC,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EACxB,CAAC,UAAU,EAAE,UAAU,EAAE,UAAU,CAAC,CACrC;AAED,MAAMC,WAAW,GAAG,CAClB,CACE,kBAAkB,EAClB,CAAC,kBAAkB,EACnB,CAAC,mBAAmB,CACrB,EACD,CACE,CAAC,kBAAkB,EACnB,kBAAkB,EAClB,mBAAmB,CACpB,EACD,CACE,mBAAmB,EACnB,CAAC,mBAA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