@chipmobilesdk/rn-theme 1.1.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 (263) hide show
  1. package/CHANGELOG.md +124 -1
  2. package/README.md +17 -12
  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
  258. package/src/color/roles.ts +3 -1
  259. package/src/theme/buildThemes.ts +84 -26
  260. package/src/theme/validateThemeConfig.ts +28 -2
  261. package/src/tokens/defaults.ts +14 -8
  262. package/src/unistyles/createUnistylesConfig.ts +4 -1
  263. package/src/vendor/mcu/index.ts +1 -1
@@ -0,0 +1,93 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { ViewingConditions } from './viewing_conditions';
18
+ /**
19
+ * HCT, hue, chroma, and tone. A color system that provides a perceptually
20
+ * accurate color measurement system that can also accurately render what colors
21
+ * will appear as in different lighting environments.
22
+ */
23
+ export declare class Hct {
24
+ private argb;
25
+ /**
26
+ * @param hue 0 <= hue < 360; invalid values are corrected.
27
+ * @param chroma 0 <= chroma < ?; Informally, colorfulness. The color
28
+ * returned may be lower than the requested chroma. Chroma has a different
29
+ * maximum for any given hue and tone.
30
+ * @param tone 0 <= tone <= 100; invalid values are corrected.
31
+ * @return HCT representation of a color in default viewing conditions.
32
+ */
33
+ internalHue: number;
34
+ internalChroma: number;
35
+ internalTone: number;
36
+ static from(hue: number, chroma: number, tone: number): Hct;
37
+ /**
38
+ * @param argb ARGB representation of a color.
39
+ * @return HCT representation of a color in default viewing conditions
40
+ */
41
+ static fromInt(argb: number): Hct;
42
+ toInt(): number;
43
+ /**
44
+ * A number, in degrees, representing ex. red, orange, yellow, etc.
45
+ * Ranges from 0 <= hue < 360.
46
+ */
47
+ get hue(): number;
48
+ /**
49
+ * @param newHue 0 <= newHue < 360; invalid values are corrected.
50
+ * Chroma may decrease because chroma has a different maximum for any given
51
+ * hue and tone.
52
+ */
53
+ set hue(newHue: number);
54
+ get chroma(): number;
55
+ /**
56
+ * @param newChroma 0 <= newChroma < ?
57
+ * Chroma may decrease because chroma has a different maximum for any given
58
+ * hue and tone.
59
+ */
60
+ set chroma(newChroma: number);
61
+ /** Lightness. Ranges from 0 to 100. */
62
+ get tone(): number;
63
+ /**
64
+ * @param newTone 0 <= newTone <= 100; invalid valids are corrected.
65
+ * Chroma may decrease because chroma has a different maximum for any given
66
+ * hue and tone.
67
+ */
68
+ set tone(newTone: number);
69
+ /** Sets a property of the Hct object. */
70
+ setValue(propertyName: string, value: number): void;
71
+ toString(): string;
72
+ static isBlue(hue: number): boolean;
73
+ static isYellow(hue: number): boolean;
74
+ static isCyan(hue: number): boolean;
75
+ private constructor();
76
+ private setInternalState;
77
+ /**
78
+ * Translates a color into different [ViewingConditions].
79
+ *
80
+ * Colors change appearance. They look different with lights on versus off,
81
+ * the same color, as in hex code, on white looks different when on black.
82
+ * This is called color relativity, most famously explicated by Josef Albers
83
+ * in Interaction of Color.
84
+ *
85
+ * In color science, color appearance models can account for this and
86
+ * calculate the appearance of a color in different settings. HCT is based on
87
+ * CAM16, a color appearance model, and uses it to make these calculations.
88
+ *
89
+ * See [ViewingConditions.make] for parameters affecting color appearance.
90
+ */
91
+ inViewingConditions(vc: ViewingConditions): Hct;
92
+ }
93
+ //# sourceMappingURL=hct.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hct.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/hct/hct.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAyBH,OAAO,EAAC,iBAAiB,EAAC,MAAM,sBAAsB,CAAC;AAGvD;;;;GAIG;AACH,qBAAa,GAAG;IAkHM,OAAO,CAAC,IAAI;IAjHhC;;;;;;;OAOG;IAEH,WAAW,EAAE,MAAM,CAAC;IACpB,cAAc,EAAE,MAAM,CAAC;IACvB,YAAY,EAAE,MAAM,CAAC;IAErB,MAAM,CAAC,IAAI,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM;IAIrD;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM;IAI3B,KAAK,IAAI,MAAM;IAIf;;;OAGG;IACH,IAAI,GAAG,IAAI,MAAM,CAEhB;IAED;;;;OAIG;IACH,IAAI,GAAG,CAAC,MAAM,EAAE,MAAM,EAQrB;IAED,IAAI,MAAM,IAAI,MAAM,CAEnB;IAED;;;;OAIG;IACH,IAAI,MAAM,CAAC,SAAS,EAAE,MAAM,EAQ3B;IAED,uCAAuC;IACvC,IAAI,IAAI,IAAI,MAAM,CAEjB;IAED;;;;OAIG;IACH,IAAI,IAAI,CAAC,OAAO,EAAE,MAAM,EAQvB;IAED,yCAAyC;IACzC,QAAQ,CAAC,YAAY,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM;IAI5C,QAAQ,IAAI,MAAM;IAKlB,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAIrC,MAAM,CAAC,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,OAAO;IAInC,OAAO;IAQP,OAAO,CAAC,gBAAgB;IAQxB;;;;;;;;;;;;;OAaG;IACH,mBAAmB,CAAC,EAAE,EAAE,iBAAiB,GAAG,GAAG;CAuBhD"}
@@ -0,0 +1,147 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Cam16 } from './cam16';
18
+ /**
19
+ * A class that solves the HCT equation.
20
+ */
21
+ export declare class HctSolver {
22
+ static SCALED_DISCOUNT_FROM_LINRGB: number[][];
23
+ static LINRGB_FROM_SCALED_DISCOUNT: number[][];
24
+ static Y_FROM_LINRGB: number[];
25
+ static CRITICAL_PLANES: number[];
26
+ /**
27
+ * Sanitizes a small enough angle in radians.
28
+ *
29
+ * @param angle An angle in radians; must not deviate too much
30
+ * from 0.
31
+ * @return A coterminal angle between 0 and 2pi.
32
+ */
33
+ private static sanitizeRadians;
34
+ /**
35
+ * Delinearizes an RGB component, returning a floating-point
36
+ * number.
37
+ *
38
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
39
+ * linear R/G/B channel
40
+ * @return 0.0 <= output <= 255.0, color channel converted to
41
+ * regular RGB space
42
+ */
43
+ private static trueDelinearized;
44
+ private static chromaticAdaptation;
45
+ /**
46
+ * Returns the hue of a linear RGB color in CAM16.
47
+ *
48
+ * @param linrgb The linear RGB coordinates of a color.
49
+ * @return The hue of the color in CAM16, in radians.
50
+ */
51
+ private static hueOf;
52
+ private static areInCyclicOrder;
53
+ /**
54
+ * Solves the lerp equation.
55
+ *
56
+ * @param source The starting number.
57
+ * @param mid The number in the middle.
58
+ * @param target The ending number.
59
+ * @return A number t such that lerp(source, target, t) = mid.
60
+ */
61
+ private static intercept;
62
+ private static lerpPoint;
63
+ /**
64
+ * Intersects a segment with a plane.
65
+ *
66
+ * @param source The coordinates of point A.
67
+ * @param coordinate The R-, G-, or B-coordinate of the plane.
68
+ * @param target The coordinates of point B.
69
+ * @param axis The axis the plane is perpendicular with. (0: R, 1:
70
+ * G, 2: B)
71
+ * @return The intersection point of the segment AB with the plane
72
+ * R=coordinate, G=coordinate, or B=coordinate
73
+ */
74
+ private static setCoordinate;
75
+ private static isBounded;
76
+ /**
77
+ * Returns the nth possible vertex of the polygonal intersection.
78
+ *
79
+ * @param y The Y value of the plane.
80
+ * @param n The zero-based index of the point. 0 <= n <= 11.
81
+ * @return The nth possible vertex of the polygonal intersection
82
+ * of the y plane and the RGB cube, in linear RGB coordinates, if
83
+ * it exists. If this possible vertex lies outside of the cube,
84
+ * [-1.0, -1.0, -1.0] is returned.
85
+ */
86
+ private static nthVertex;
87
+ /**
88
+ * Finds the segment containing the desired color.
89
+ *
90
+ * @param y The Y value of the color.
91
+ * @param targetHue The hue of the color.
92
+ * @return A list of two sets of linear RGB coordinates, each
93
+ * corresponding to an endpoint of the segment containing the
94
+ * desired color.
95
+ */
96
+ private static bisectToSegment;
97
+ private static midpoint;
98
+ private static criticalPlaneBelow;
99
+ private static criticalPlaneAbove;
100
+ /**
101
+ * Finds a color with the given Y and hue on the boundary of the
102
+ * cube.
103
+ *
104
+ * @param y The Y value of the color.
105
+ * @param targetHue The hue of the color.
106
+ * @return The desired color, in linear RGB coordinates.
107
+ */
108
+ private static bisectToLimit;
109
+ private static inverseChromaticAdaptation;
110
+ /**
111
+ * Finds a color with the given hue, chroma, and Y.
112
+ *
113
+ * @param hueRadians The desired hue in radians.
114
+ * @param chroma The desired chroma.
115
+ * @param y The desired Y.
116
+ * @return The desired color as a hexadecimal integer, if found; 0
117
+ * otherwise.
118
+ */
119
+ private static findResultByJ;
120
+ /**
121
+ * Finds an sRGB color with the given hue, chroma, and L*, if
122
+ * possible.
123
+ *
124
+ * @param hueDegrees The desired hue, in degrees.
125
+ * @param chroma The desired chroma.
126
+ * @param lstar The desired L*.
127
+ * @return A hexadecimal representing the sRGB color. The color
128
+ * has sufficiently close hue, chroma, and L* to the desired
129
+ * values, if possible; otherwise, the hue and L* will be
130
+ * sufficiently close, and chroma will be maximized.
131
+ */
132
+ static solveToInt(hueDegrees: number, chroma: number, lstar: number): number;
133
+ /**
134
+ * Finds an sRGB color with the given hue, chroma, and L*, if
135
+ * possible.
136
+ *
137
+ * @param hueDegrees The desired hue, in degrees.
138
+ * @param chroma The desired chroma.
139
+ * @param lstar The desired L*.
140
+ * @return An CAM16 object representing the sRGB color. The color
141
+ * has sufficiently close hue, chroma, and L* to the desired
142
+ * values, if possible; otherwise, the hue and L* will be
143
+ * sufficiently close, and chroma will be maximized.
144
+ */
145
+ static solveToCam(hueDegrees: number, chroma: number, lstar: number): Cam16;
146
+ }
147
+ //# sourceMappingURL=hct_solver.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"hct_solver.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/hct/hct_solver.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAUH,OAAO,EAAC,KAAK,EAAC,MAAM,SAAS,CAAC;AAS9B;;GAEG;AACH,qBAAa,SAAS;IACpB,MAAM,CAAC,2BAA2B,aAgBhC;IAEF,MAAM,CAAC,2BAA2B,aAgBhC;IAEF,MAAM,CAAC,aAAa,WAA4B;IAEhD,MAAM,CAAC,eAAe,WAsFpB;IAEF;;;;;;OAMG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAI9B;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAW/B,OAAO,CAAC,MAAM,CAAC,mBAAmB;IAKlC;;;;;OAKG;IACH,OAAO,CAAC,MAAM,CAAC,KAAK;IAapB,OAAO,CAAC,MAAM,CAAC,gBAAgB;IAM/B;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAKxB,OAAO,CAAC,MAAM,CAAC,SAAS;IASxB;;;;;;;;;;OAUG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAU5B,OAAO,CAAC,MAAM,CAAC,SAAS;IAIxB;;;;;;;;;OASG;IACH,OAAO,CAAC,MAAM,CAAC,SAAS;IAoCxB;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,eAAe;IAmC9B,OAAO,CAAC,MAAM,CAAC,QAAQ;IAQvB,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC,OAAO,CAAC,MAAM,CAAC,kBAAkB;IAIjC;;;;;;;OAOG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IA4C5B,OAAO,CAAC,MAAM,CAAC,0BAA0B;IAMzC;;;;;;;;OAQG;IACH,OAAO,CAAC,MAAM,CAAC,aAAa;IAqE5B;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM;IAe5E;;;;;;;;;;;OAWG;IACH,MAAM,CAAC,UAAU,CAAC,UAAU,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,KAAK;CAG5E"}
@@ -0,0 +1,75 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * In traditional color spaces, a color can be identified solely by the
19
+ * observer's measurement of the color. Color appearance models such as CAM16
20
+ * also use information about the environment where the color was
21
+ * observed, known as the viewing conditions.
22
+ *
23
+ * For example, white under the traditional assumption of a midday sun white
24
+ * point is accurately measured as a slightly chromatic blue by CAM16. (roughly,
25
+ * hue 203, chroma 3, lightness 100)
26
+ *
27
+ * This class caches intermediate values of the CAM16 conversion process that
28
+ * depend only on viewing conditions, enabling speed ups.
29
+ */
30
+ export declare class ViewingConditions {
31
+ n: number;
32
+ aw: number;
33
+ nbb: number;
34
+ ncb: number;
35
+ c: number;
36
+ nc: number;
37
+ rgbD: number[];
38
+ fl: number;
39
+ fLRoot: number;
40
+ z: number;
41
+ /** sRGB-like viewing conditions. */
42
+ static DEFAULT: ViewingConditions;
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?: number[], adaptingLuminance?: number, backgroundLstar?: number, surround?: number, discountingIlluminant?: boolean): ViewingConditions;
66
+ /**
67
+ * Parameters are intermediate values of the CAM16 conversion process. Their
68
+ * names are shorthand for technical color science terminology, this class
69
+ * would not benefit from documenting them individually. A brief overview
70
+ * is available in the CAM16 specification, and a complete overview requires
71
+ * a color science textbook, such as Fairchild's Color Appearance Models.
72
+ */
73
+ private constructor();
74
+ }
75
+ //# sourceMappingURL=viewing_conditions.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"viewing_conditions.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/hct/viewing_conditions.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAQH;;;;;;;;;;;;GAYG;AACH,qBAAa,iBAAiB;IAgFjB,CAAC,EAAE,MAAM;IAAS,EAAE,EAAE,MAAM;IAAS,GAAG,EAAE,MAAM;IAChD,GAAG,EAAE,MAAM;IAAS,CAAC,EAAE,MAAM;IAAS,EAAE,EAAE,MAAM;IAChD,IAAI,EAAE,MAAM,EAAE;IAAS,EAAE,EAAE,MAAM;IAAS,MAAM,EAAE,MAAM;IACxD,CAAC,EAAE,MAAM;IAlFpB,qCAAqC;IACrC,MAAM,CAAC,OAAO,oBAA4B;IAE1C;;;;;;;;;;;;;;;;;;;;;OAqBG;IACH,MAAM,CAAC,IAAI,CACP,UAAU,WAAwB,EAClC,iBAAiB,SAAqD,EACtE,eAAe,SAAO,EAAE,QAAQ,SAAM,EACtC,qBAAqB,UAAQ,GAAG,iBAAiB;IA0CrD;;;;;;OAMG;IACH,OAAO;CAKR"}
@@ -0,0 +1,4 @@
1
+ export { Hct } from './hct/hct';
2
+ export { TonalPalette } from './palettes/tonal_palette';
3
+ export { argbFromRgb } from './utils/color_utils';
4
+ //# sourceMappingURL=index.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../src/vendor/mcu/index.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,GAAG,EAAE,MAAM,WAAW,CAAC;AAChC,OAAO,EAAE,YAAY,EAAE,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC"}
@@ -0,0 +1,56 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ import { Hct } from '../hct/hct';
18
+ /**
19
+ * A convenience class for retrieving colors that are constant in hue and
20
+ * chroma, but vary in tone.
21
+ */
22
+ export declare class TonalPalette {
23
+ readonly hue: number;
24
+ readonly chroma: number;
25
+ readonly keyColor: Hct;
26
+ private readonly cache;
27
+ /**
28
+ * @param argb ARGB representation of a color
29
+ * @return Tones matching that color's hue and chroma.
30
+ */
31
+ static fromInt(argb: number): TonalPalette;
32
+ /**
33
+ * @param hct Hct
34
+ * @return Tones matching that color's hue and chroma.
35
+ */
36
+ static fromHct(hct: Hct): TonalPalette;
37
+ /**
38
+ * @param hue HCT hue
39
+ * @param chroma HCT chroma
40
+ * @return Tones matching hue and chroma.
41
+ */
42
+ static fromHueAndChroma(hue: number, chroma: number): TonalPalette;
43
+ private constructor();
44
+ /**
45
+ * @param tone HCT tone, measured from 0 to 100.
46
+ * @return ARGB representation of a color with that tone.
47
+ */
48
+ tone(tone: number): number;
49
+ /**
50
+ * @param tone HCT tone.
51
+ * @return HCT representation of a color with that tone.
52
+ */
53
+ getHct(tone: number): Hct;
54
+ private averageArgb;
55
+ }
56
+ //# sourceMappingURL=tonal_palette.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"tonal_palette.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/palettes/tonal_palette.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAKH,OAAO,EAAC,GAAG,EAAC,MAAM,YAAY,CAAC;AAE/B;;;GAGG;AACH,qBAAa,YAAY;IA+BnB,QAAQ,CAAC,GAAG,EAAE,MAAM;IAAE,QAAQ,CAAC,MAAM,EAAE,MAAM;IAAE,QAAQ,CAAC,QAAQ,EAAE,GAAG;IA9BzE,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA6B;IAEnD;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,MAAM,GAAG,YAAY;IAK1C;;;OAGG;IACH,MAAM,CAAC,OAAO,CAAC,GAAG,EAAE,GAAG;IAIvB;;;;OAIG;IACH,MAAM,CAAC,gBAAgB,CAAC,GAAG,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,YAAY;IAKlE,OAAO;IAGP;;;OAGG;IACH,IAAI,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM;IAa1B;;;OAGG;IACH,MAAM,CAAC,IAAI,EAAE,MAAM,GAAG,GAAG;IAIzB,OAAO,CAAC,WAAW;CAcpB"}
@@ -0,0 +1,129 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Converts a color from RGB components to ARGB format.
19
+ */
20
+ export declare function argbFromRgb(red: number, green: number, blue: number): number;
21
+ /**
22
+ * Converts a color from linear RGB components to ARGB format.
23
+ */
24
+ export declare function argbFromLinrgb(linrgb: number[]): number;
25
+ /**
26
+ * Returns the alpha component of a color in ARGB format.
27
+ */
28
+ export declare function alphaFromArgb(argb: number): number;
29
+ /**
30
+ * Returns the red component of a color in ARGB format.
31
+ */
32
+ export declare function redFromArgb(argb: number): number;
33
+ /**
34
+ * Returns the green component of a color in ARGB format.
35
+ */
36
+ export declare function greenFromArgb(argb: number): number;
37
+ /**
38
+ * Returns the blue component of a color in ARGB format.
39
+ */
40
+ export declare function blueFromArgb(argb: number): number;
41
+ /**
42
+ * Returns whether a color in ARGB format is opaque.
43
+ */
44
+ export declare function isOpaque(argb: number): boolean;
45
+ /**
46
+ * Converts a color from ARGB to XYZ.
47
+ */
48
+ export declare function argbFromXyz(x: number, y: number, z: number): number;
49
+ /**
50
+ * Converts a color from XYZ to ARGB.
51
+ */
52
+ export declare function xyzFromArgb(argb: number): number[];
53
+ /**
54
+ * Converts a color represented in Lab color space into an ARGB
55
+ * integer.
56
+ */
57
+ export declare function argbFromLab(l: number, a: number, b: number): number;
58
+ /**
59
+ * Converts a color from ARGB representation to L*a*b*
60
+ * representation.
61
+ *
62
+ * @param argb the ARGB representation of a color
63
+ * @return a Lab object representing the color
64
+ */
65
+ export declare function labFromArgb(argb: number): number[];
66
+ /**
67
+ * Converts an L* value to an ARGB representation.
68
+ *
69
+ * @param lstar L* in L*a*b*
70
+ * @return ARGB representation of grayscale color with lightness
71
+ * matching L*
72
+ */
73
+ export declare function argbFromLstar(lstar: number): number;
74
+ /**
75
+ * Computes the L* value of a color in ARGB representation.
76
+ *
77
+ * @param argb ARGB representation of a color
78
+ * @return L*, from L*a*b*, coordinate of the color
79
+ */
80
+ export declare function lstarFromArgb(argb: number): number;
81
+ /**
82
+ * Converts an L* value to a Y value.
83
+ *
84
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
85
+ *
86
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
87
+ * measures relative luminance, a logarithmic scale.
88
+ *
89
+ * @param lstar L* in L*a*b*
90
+ * @return Y in XYZ
91
+ */
92
+ export declare function yFromLstar(lstar: number): number;
93
+ /**
94
+ * Converts a Y value to an L* value.
95
+ *
96
+ * L* in L*a*b* and Y in XYZ measure the same quantity, luminance.
97
+ *
98
+ * L* measures perceptual luminance, a linear scale. Y in XYZ
99
+ * measures relative luminance, a logarithmic scale.
100
+ *
101
+ * @param y Y in XYZ
102
+ * @return L* in L*a*b*
103
+ */
104
+ export declare function lstarFromY(y: number): number;
105
+ /**
106
+ * Linearizes an RGB component.
107
+ *
108
+ * @param rgbComponent 0 <= rgb_component <= 255, represents R/G/B
109
+ * channel
110
+ * @return 0.0 <= output <= 100.0, color channel converted to
111
+ * linear RGB space
112
+ */
113
+ export declare function linearized(rgbComponent: number): number;
114
+ /**
115
+ * Delinearizes an RGB component.
116
+ *
117
+ * @param rgbComponent 0.0 <= rgb_component <= 100.0, represents
118
+ * linear R/G/B channel
119
+ * @return 0 <= output <= 255, color channel converted to regular
120
+ * RGB space
121
+ */
122
+ export declare function delinearized(rgbComponent: number): number;
123
+ /**
124
+ * Returns the standard white point; white on a sunny day.
125
+ *
126
+ * @return The white point
127
+ */
128
+ export declare function whitePointD65(): number[];
129
+ //# sourceMappingURL=color_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"color_utils.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/utils/color_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AA0CH;;GAEG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,MAAM,CAG5E;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,MAAM,EAAE,MAAM,EAAE,GAAG,MAAM,CAKvD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;GAEG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAElD;AAED;;GAEG;AACH,wBAAgB,YAAY,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAEjD;AAED;;GAEG;AACH,wBAAgB,QAAQ,CAAC,IAAI,EAAE,MAAM,GAAG,OAAO,CAE9C;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CASnE;AAED;;GAEG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAKlD;AAED;;;GAGG;AACH,wBAAgB,WAAW,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAYnE;AAED;;;;;;GAMG;AACH,wBAAgB,WAAW,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,EAAE,CAsBlD;AAED;;;;;;GAMG;AACH,wBAAgB,aAAa,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAInD;AAED;;;;;GAKG;AACH,wBAAgB,aAAa,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAGlD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,MAAM,CAEhD;AAED;;;;;;;;;;GAUG;AACH,wBAAgB,UAAU,CAAC,CAAC,EAAE,MAAM,GAAG,MAAM,CAE5C;AAED;;;;;;;GAOG;AACH,wBAAgB,UAAU,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CAOvD;AAED;;;;;;;GAOG;AACH,wBAAgB,YAAY,CAAC,YAAY,EAAE,MAAM,GAAG,MAAM,CASzD;AAED;;;;GAIG;AACH,wBAAgB,aAAa,IAAI,MAAM,EAAE,CAExC"}
@@ -0,0 +1,83 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2021 Google LLC
4
+ *
5
+ * Licensed under the Apache License, Version 2.0 (the "License");
6
+ * you may not use this file except in compliance with the License.
7
+ * You may obtain a copy of the License at
8
+ *
9
+ * http://www.apache.org/licenses/LICENSE-2.0
10
+ *
11
+ * Unless required by applicable law or agreed to in writing, software
12
+ * distributed under the License is distributed on an "AS IS" BASIS,
13
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14
+ * See the License for the specific language governing permissions and
15
+ * limitations under the License.
16
+ */
17
+ /**
18
+ * Utility methods for mathematical operations.
19
+ */
20
+ /**
21
+ * The signum function.
22
+ *
23
+ * @return 1 if num > 0, -1 if num < 0, and 0 if num = 0
24
+ */
25
+ export declare function signum(num: number): number;
26
+ /**
27
+ * The linear interpolation function.
28
+ *
29
+ * @return start if amount = 0 and stop if amount = 1
30
+ */
31
+ export declare function lerp(start: number, stop: number, amount: number): number;
32
+ /**
33
+ * Clamps an integer between two integers.
34
+ *
35
+ * @return input when min <= input <= max, and either min or max
36
+ * otherwise.
37
+ */
38
+ export declare function clampInt(min: number, max: number, input: number): number;
39
+ /**
40
+ * Clamps an integer between two floating-point numbers.
41
+ *
42
+ * @return input when min <= input <= max, and either min or max
43
+ * otherwise.
44
+ */
45
+ export declare function clampDouble(min: number, max: number, input: number): number;
46
+ /**
47
+ * Sanitizes a degree measure as an integer.
48
+ *
49
+ * @return a degree measure between 0 (inclusive) and 360
50
+ * (exclusive).
51
+ */
52
+ export declare function sanitizeDegreesInt(degrees: number): number;
53
+ /**
54
+ * Sanitizes a degree measure as a floating-point number.
55
+ *
56
+ * @return a degree measure between 0.0 (inclusive) and 360.0
57
+ * (exclusive).
58
+ */
59
+ export declare function sanitizeDegreesDouble(degrees: number): number;
60
+ /**
61
+ * Sign of direction change needed to travel from one angle to
62
+ * another.
63
+ *
64
+ * For angles that are 180 degrees apart from each other, both
65
+ * directions have the same travel distance, so either direction is
66
+ * shortest. The value 1.0 is returned in this case.
67
+ *
68
+ * @param from The angle travel starts from, in degrees.
69
+ * @param to The angle travel ends at, in degrees.
70
+ * @return -1 if decreasing from leads to the shortest travel
71
+ * distance, 1 if increasing from leads to the shortest travel
72
+ * distance.
73
+ */
74
+ export declare function rotationDirection(from: number, to: number): number;
75
+ /**
76
+ * Distance of two points on a circle, represented using degrees.
77
+ */
78
+ export declare function differenceDegrees(a: number, b: number): number;
79
+ /**
80
+ * Multiplies a 1x3 row vector with a 3x3 matrix.
81
+ */
82
+ export declare function matrixMultiply(row: number[], matrix: number[][]): number[];
83
+ //# sourceMappingURL=math_utils.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"math_utils.d.ts","sourceRoot":"","sources":["../../../../../../src/vendor/mcu/utils/math_utils.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;GAeG;AAOH;;GAEG;AAEH;;;;GAIG;AACH,wBAAgB,MAAM,CAAC,GAAG,EAAE,MAAM,GAAG,MAAM,CAQ1C;AAED;;;;GAIG;AACH,wBAAgB,IAAI,CAAC,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,EAAE,MAAM,EAAE,MAAM,GAAG,MAAM,CAExE;AAED;;;;;GAKG;AACH,wBAAgB,QAAQ,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQxE;AAED;;;;;GAKG;AACH,wBAAgB,WAAW,CAAC,GAAG,EAAE,MAAM,EAAE,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,GAAG,MAAM,CAQ3E;AAED;;;;;GAKG;AACH,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM1D;AAED;;;;;GAKG;AACH,wBAAgB,qBAAqB,CAAC,OAAO,EAAE,MAAM,GAAG,MAAM,CAM7D;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAgB,iBAAiB,CAAC,IAAI,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,GAAG,MAAM,CAGlE;AAED;;GAEG;AACH,wBAAgB,iBAAiB,CAAC,CAAC,EAAE,MAAM,EAAE,CAAC,EAAE,MAAM,GAAG,MAAM,CAE9D;AAED;;GAEG;AACH,wBAAgB,cAAc,CAAC,GAAG,EAAE,MAAM,EAAE,EAAE,MAAM,EAAE,MAAM,EAAE,EAAE,GAAG,MAAM,EAAE,CAQ1E"}
@@ -0,0 +1,7 @@
1
+ import type { ColorScheme } from '../types/colors.js';
2
+ /**
3
+ * Categorical series colours for charts, starting at the primary hue
4
+ * (spec US-11). Status colours stay free for status.
5
+ */
6
+ export declare function buildCategorical(primary: string, scheme: ColorScheme): string[];
7
+ //# sourceMappingURL=categorical.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"categorical.d.ts","sourceRoot":"","sources":["../../../../src/color/categorical.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,oBAAiB,CAAC;AAkBnD;;;GAGG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,WAAW,GAAG,MAAM,EAAE,CAS/E"}
@@ -0,0 +1,26 @@
1
+ /** WCAG 2.x minimum ratio for text (1.4.3). */
2
+ export declare const TEXT_CONTRAST = 4.5;
3
+ /** WCAG 2.x minimum ratio for non-text boundaries (1.4.11). */
4
+ export declare const NON_TEXT_CONTRAST = 3;
5
+ export interface ContrastFailure {
6
+ /** Theme path of the foreground value, e.g. `color.onPrimary`. */
7
+ foreground: string;
8
+ /** Theme path of the background value, e.g. `color.primary`. */
9
+ background: string;
10
+ ratio: number;
11
+ target: number;
12
+ }
13
+ /**
14
+ * WCAG contrast ratio of two colour strings. Translucent colours are
15
+ * composited first: the background over `base` (default white), then the
16
+ * foreground over the result.
17
+ */
18
+ export declare function contrastRatio(foreground: string, background: string, base?: string): number;
19
+ /**
20
+ * Checks every contrast pair the package guarantees against the given theme
21
+ * and returns the ones below target. An empty list means the theme passes.
22
+ * `color.disabled` is never audited: inactive components are exempt from
23
+ * WCAG 1.4.3.
24
+ */
25
+ export declare function auditTheme(theme: object): ContrastFailure[];
26
+ //# sourceMappingURL=contrast.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"contrast.d.ts","sourceRoot":"","sources":["../../../../src/color/contrast.ts"],"names":[],"mappings":"AAEA,+CAA+C;AAC/C,eAAO,MAAM,aAAa,MAAM,CAAC;AACjC,+DAA+D;AAC/D,eAAO,MAAM,iBAAiB,IAAI,CAAC;AAKnC,MAAM,WAAW,eAAe;IAC/B,kEAAkE;IAClE,UAAU,EAAE,MAAM,CAAC;IACnB,gEAAgE;IAChE,UAAU,EAAE,MAAM,CAAC;IACnB,KAAK,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,MAAM,CAAC;CACf;AA+JD;;;;GAIG;AACH,wBAAgB,aAAa,CAAC,UAAU,EAAE,MAAM,EAAE,UAAU,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,MAAM,GAAG,MAAM,CAkB3F;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,KAAK,EAAE,MAAM,GAAG,eAAe,EAAE,CAyB3D"}