_constants.scss 6.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289
  1. //
  2. // Copyright 2017 Google Inc.
  3. //
  4. // Permission is hereby granted, free of charge, to any person obtaining a copy
  5. // of this software and associated documentation files (the "Software"), to deal
  6. // in the Software without restriction, including without limitation the rights
  7. // to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
  8. // copies of the Software, and to permit persons to whom the Software is
  9. // furnished to do so, subject to the following conditions:
  10. //
  11. // The above copyright notice and this permission notice shall be included in
  12. // all copies or substantial portions of the Software.
  13. //
  14. // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
  15. // IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
  16. // FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
  17. // AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
  18. // LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
  19. // OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
  20. // THE SOFTWARE.
  21. //
  22. // Precomputed linear color channel values, for use in contrast calculations.
  23. // See https://www.w3.org/TR/WCAG20-TECHS/G17.html#G17-tests
  24. //
  25. // Algorithm, for c in 0 to 255:
  26. // f(c) {
  27. // c = c / 255;
  28. // return c < 0.03928 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
  29. // }
  30. //
  31. // This lookup table is needed since there is no `pow` in SASS.
  32. $linear-channel-values:
  33. 0
  34. .0003035269835488375
  35. .000607053967097675
  36. .0009105809506465125
  37. .00121410793419535
  38. .0015176349177441874
  39. .001821161901293025
  40. .0021246888848418626
  41. .0024282158683907
  42. .0027317428519395373
  43. .003035269835488375
  44. .003346535763899161
  45. .003676507324047436
  46. .004024717018496307
  47. .004391442037410293
  48. .004776953480693729
  49. .005181516702338386
  50. .005605391624202723
  51. .006048833022857054
  52. .006512090792594475
  53. .006995410187265387
  54. .007499032043226175
  55. .008023192985384994
  56. .008568125618069307
  57. .009134058702220787
  58. .00972121732023785
  59. .010329823029626936
  60. .010960094006488246
  61. .011612245179743885
  62. .012286488356915872
  63. .012983032342173012
  64. .013702083047289686
  65. .014443843596092545
  66. .01520851442291271
  67. .01599629336550963
  68. .016807375752887384
  69. .017641954488384078
  70. .018500220128379697
  71. .019382360956935723
  72. .0202885630566524
  73. .021219010376003555
  74. .022173884793387385
  75. .02315336617811041
  76. .024157632448504756
  77. .02518685962736163
  78. .026241221894849898
  79. .027320891639074894
  80. .028426039504420793
  81. .0295568344378088
  82. .030713443732993635
  83. .03189603307301153
  84. .033104766570885055
  85. .03433980680868217
  86. .03560131487502034
  87. .03688945040110004
  88. .0382043715953465
  89. .03954623527673284
  90. .04091519690685319
  91. .042311410620809675
  92. .043735029256973465
  93. .04518620438567554
  94. .046665086336880095
  95. .04817182422688942
  96. .04970656598412723
  97. .05126945837404324
  98. .052860647023180246
  99. .05448027644244237
  100. .05612849004960009
  101. .05780543019106723
  102. .0595112381629812
  103. .06124605423161761
  104. .06301001765316767
  105. .06480326669290577
  106. .06662593864377289
  107. .06847816984440017
  108. .07036009569659588
  109. .07227185068231748
  110. .07421356838014963
  111. .07618538148130785
  112. .07818742180518633
  113. .08021982031446832
  114. .0822827071298148
  115. .08437621154414882
  116. .08650046203654976
  117. .08865558628577294
  118. .09084171118340768
  119. .09305896284668745
  120. .0953074666309647
  121. .09758734714186246
  122. .09989872824711389
  123. .10224173308810132
  124. .10461648409110419
  125. .10702310297826761
  126. .10946171077829933
  127. .1119324278369056
  128. .11443537382697373
  129. .11697066775851084
  130. .11953842798834562
  131. .12213877222960187
  132. .12477181756095049
  133. .12743768043564743
  134. .1301364766903643
  135. .13286832155381798
  136. .13563332965520566
  137. .13843161503245183
  138. .14126329114027164
  139. .14412847085805777
  140. .14702726649759498
  141. .14995978981060856
  142. .15292615199615017
  143. .1559264637078274
  144. .1589608350608804
  145. .162029375639111
  146. .1651321945016676
  147. .16826940018969075
  148. .1714411007328226
  149. .17464740365558504
  150. .17788841598362912
  151. .18116424424986022
  152. .184474994500441
  153. .18782077230067787
  154. .19120168274079138
  155. .1946178304415758
  156. .19806931955994886
  157. .20155625379439707
  158. .20507873639031693
  159. .20863687014525575
  160. .21223075741405523
  161. .21586050011389926
  162. .2195261997292692
  163. .2232279573168085
  164. .22696587351009836
  165. .23074004852434915
  166. .23455058216100522
  167. .238397573812271
  168. .24228112246555486
  169. .24620132670783548
  170. .25015828472995344
  171. .25415209433082675
  172. .2581828529215958
  173. .26225065752969623
  174. .26635560480286247
  175. .2704977910130658
  176. .27467731206038465
  177. .2788942634768104
  178. .2831487404299921
  179. .2874408377269175
  180. .29177064981753587
  181. .2961382707983211
  182. .3005437944157765
  183. .3049873140698863
  184. .30946892281750854
  185. .31398871337571754
  186. .31854677812509186
  187. .32314320911295075
  188. .3277780980565422
  189. .33245153634617935
  190. .33716361504833037
  191. .3419144249086609
  192. .3467040563550296
  193. .35153259950043936
  194. .3564001441459435
  195. .3613067797835095
  196. .3662525955988395
  197. .3712376804741491
  198. .3762621229909065
  199. .38132601143253014
  200. .386429433787049
  201. .39157247774972326
  202. .39675523072562685
  203. .4019777798321958
  204. .4072402119017367
  205. .41254261348390375
  206. .4178850708481375
  207. .4232676699860717
  208. .4286904966139066
  209. .43415363617474895
  210. .4396571738409188
  211. .44520119451622786
  212. .45078578283822346
  213. .45641102318040466
  214. .4620769996544071
  215. .467783796112159
  216. .47353149614800955
  217. .4793201831008268
  218. .4851499400560704
  219. .4910208498478356
  220. .4969329950608704
  221. .5028864580325687
  222. .5088813208549338
  223. .5149176653765214
  224. .5209955732043543
  225. .5271151257058131
  226. .5332764040105052
  227. .5394794890121072
  228. .5457244613701866
  229. .5520114015120001
  230. .5583403896342679
  231. .5647115057049292
  232. .5711248294648731
  233. .5775804404296506
  234. .5840784178911641
  235. .5906188409193369
  236. .5972017883637634
  237. .6038273388553378
  238. .6104955708078648
  239. .6172065624196511
  240. .6239603916750761
  241. .6307571363461468
  242. .6375968739940326
  243. .6444796819705821
  244. .6514056374198242
  245. .6583748172794485
  246. .665387298282272
  247. .6724431569576875
  248. .6795424696330938
  249. .6866853124353135
  250. .6938717612919899
  251. .7011018919329731
  252. .7083757798916868
  253. .7156935005064807
  254. .7230551289219693
  255. .7304607400903537
  256. .7379104087727308
  257. .7454042095403874
  258. .7529422167760779
  259. .7605245046752924
  260. .768151147247507
  261. .7758222183174236
  262. .7835377915261935
  263. .7912979403326302
  264. .799102738014409
  265. .8069522576692516
  266. .8148465722161012
  267. .8227857543962835
  268. .8307698767746546
  269. .83879901174074
  270. .846873231509858
  271. .8549926081242338
  272. .8631572134541023
  273. .8713671191987972
  274. .8796223968878317
  275. .8879231178819663
  276. .8962693533742664
  277. .9046611743911496
  278. .9130986517934192
  279. .9215818562772946
  280. .9301108583754237
  281. .938685728457888
  282. .9473065367331999
  283. .9559733532492861
  284. .9646862478944651
  285. .9734452903984125
  286. .9822505503331171
  287. .9911020971138298
  288. 1;