tokens.js 4.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /*
  2. * Licensed to the Apache Software Foundation (ASF) under one
  3. * or more contributor license agreements. See the NOTICE file
  4. * distributed with this work for additional information
  5. * regarding copyright ownership. The ASF licenses this file
  6. * to you under the Apache License, Version 2.0 (the
  7. * "License"); you may not use this file except in compliance
  8. * with the License. You may obtain a copy of the License at
  9. *
  10. * http://www.apache.org/licenses/LICENSE-2.0
  11. *
  12. * Unless required by applicable law or agreed to in writing,
  13. * software distributed under the License is distributed on an
  14. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  15. * KIND, either express or implied. See the License for the
  16. * specific language governing permissions and limitations
  17. * under the License.
  18. */
  19. /**
  20. * AUTO-GENERATED FILE. DO NOT MODIFY.
  21. */
  22. /*
  23. * Licensed to the Apache Software Foundation (ASF) under one
  24. * or more contributor license agreements. See the NOTICE file
  25. * distributed with this work for additional information
  26. * regarding copyright ownership. The ASF licenses this file
  27. * to you under the Apache License, Version 2.0 (the
  28. * "License"); you may not use this file except in compliance
  29. * with the License. You may obtain a copy of the License at
  30. *
  31. * http://www.apache.org/licenses/LICENSE-2.0
  32. *
  33. * Unless required by applicable law or agreed to in writing,
  34. * software distributed under the License is distributed on an
  35. * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
  36. * KIND, either express or implied. See the License for the
  37. * specific language governing permissions and limitations
  38. * under the License.
  39. */
  40. import { extend } from 'zrender/lib/core/util.js';
  41. import { modifyHSL } from 'zrender/lib/tool/color.js';
  42. var tokens = {
  43. color: {},
  44. darkColor: {},
  45. size: {}
  46. };
  47. var color = tokens.color = {
  48. theme: ['#5070dd', '#b6d634', '#505372', '#ff994d', '#0ca8df', '#ffd10a', '#fb628b', '#785db0', '#3fbe95'],
  49. neutral00: '#fff',
  50. neutral05: '#f4f7fd',
  51. neutral10: '#e8ebf0',
  52. neutral15: '#dbdee4',
  53. neutral20: '#cfd2d7',
  54. neutral25: '#c3c5cb',
  55. neutral30: '#b7b9be',
  56. neutral35: '#aaacb2',
  57. neutral40: '#9ea0a5',
  58. neutral45: '#929399',
  59. neutral50: '#86878c',
  60. neutral55: '#797b7f',
  61. neutral60: '#6d6e73',
  62. neutral65: '#616266',
  63. neutral70: '#54555a',
  64. neutral75: '#48494d',
  65. neutral80: '#3c3c41',
  66. neutral85: '#303034',
  67. neutral90: '#232328',
  68. neutral95: '#17171b',
  69. neutral99: '#000',
  70. accent05: '#eff1f9',
  71. accent10: '#e0e4f2',
  72. accent15: '#d0d6ec',
  73. accent20: '#c0c9e6',
  74. accent25: '#b1bbdf',
  75. accent30: '#a1aed9',
  76. accent35: '#91a0d3',
  77. accent40: '#8292cc',
  78. accent45: '#7285c6',
  79. accent50: '#6578ba',
  80. accent55: '#5c6da9',
  81. accent60: '#536298',
  82. accent65: '#4a5787',
  83. accent70: '#404c76',
  84. accent75: '#374165',
  85. accent80: '#2e3654',
  86. accent85: '#252b43',
  87. accent90: '#1b2032',
  88. accent95: '#121521',
  89. transparent: 'rgba(0,0,0,0)',
  90. highlight: 'rgba(255,231,130,0.8)'
  91. };
  92. extend(color, {
  93. primary: color.neutral80,
  94. secondary: color.neutral70,
  95. tertiary: color.neutral60,
  96. quaternary: color.neutral50,
  97. disabled: color.neutral20,
  98. border: color.neutral30,
  99. borderTint: color.neutral20,
  100. borderShade: color.neutral40,
  101. background: color.neutral05,
  102. backgroundTint: 'rgba(234,237,245,0.5)',
  103. backgroundTransparent: 'rgba(255,255,255,0)',
  104. backgroundShade: color.neutral10,
  105. shadow: 'rgba(0,0,0,0.2)',
  106. shadowTint: 'rgba(129,130,136,0.2)',
  107. axisLine: color.neutral70,
  108. axisLineTint: color.neutral40,
  109. axisTick: color.neutral70,
  110. axisTickMinor: color.neutral60,
  111. axisLabel: color.neutral70,
  112. axisSplitLine: color.neutral15,
  113. axisMinorSplitLine: color.neutral05
  114. });
  115. for (var key in color) {
  116. if (color.hasOwnProperty(key)) {
  117. var hex = color[key];
  118. if (key === 'theme') {
  119. // Don't modify theme colors.
  120. tokens.darkColor.theme = color.theme.slice();
  121. } else if (key === 'highlight') {
  122. tokens.darkColor.highlight = 'rgba(255,231,130,0.4)';
  123. } else if (key.indexOf('accent') === 0) {
  124. // Desaturate and lighten accent colors.
  125. tokens.darkColor[key] = modifyHSL(hex, null, function (s) {
  126. return s * 0.5;
  127. }, function (l) {
  128. return Math.min(1, 1.3 - l);
  129. });
  130. } else {
  131. tokens.darkColor[key] = modifyHSL(hex, null, function (s) {
  132. return s * 0.9;
  133. }, function (l) {
  134. return 1 - Math.pow(l, 1.5);
  135. });
  136. }
  137. }
  138. }
  139. tokens.size = {
  140. xxs: 2,
  141. xs: 5,
  142. s: 10,
  143. m: 15,
  144. l: 20,
  145. xl: 30,
  146. xxl: 40,
  147. xxxl: 50
  148. };
  149. export default tokens;