HighContrastDark.js 4.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210
  1. /* *
  2. *
  3. * (c) 2010-2020 Highsoft AS
  4. *
  5. * Author: Øystein Moseng
  6. *
  7. * License: www.highcharts.com/license
  8. *
  9. * Accessible high-contrast dark theme for Highcharts. Specifically tailored
  10. * towards 3:1 contrast against black/off-black backgrounds. Neighboring
  11. * colors are tested for color blindness.
  12. *
  13. * !!!!!!! SOURCE GETS TRANSPILED BY TYPESCRIPT. EDIT TS FILE ONLY. !!!!!!!
  14. *
  15. * */
  16. import H from '../../Core/Globals.js';
  17. import U from '../../Core/Utilities.js';
  18. var setOptions = U.setOptions;
  19. var textBright = '#F0F0F3';
  20. H.theme = {
  21. colors: [
  22. '#a6f0ff',
  23. '#70d49e',
  24. '#e898a5',
  25. '#007faa',
  26. '#f9db72',
  27. '#f45b5b',
  28. '#1e824c',
  29. '#e7934c',
  30. '#dadfe1',
  31. '#a0618b'
  32. ],
  33. chart: {
  34. backgroundColor: '#1f1f20',
  35. plotBorderColor: '#606063'
  36. },
  37. title: {
  38. style: {
  39. color: textBright
  40. }
  41. },
  42. subtitle: {
  43. style: {
  44. color: textBright
  45. }
  46. },
  47. xAxis: {
  48. gridLineColor: '#707073',
  49. labels: {
  50. style: {
  51. color: textBright
  52. }
  53. },
  54. lineColor: '#707073',
  55. minorGridLineColor: '#505053',
  56. tickColor: '#707073',
  57. title: {
  58. style: {
  59. color: textBright
  60. }
  61. }
  62. },
  63. yAxis: {
  64. gridLineColor: '#707073',
  65. labels: {
  66. style: {
  67. color: textBright
  68. }
  69. },
  70. lineColor: '#707073',
  71. minorGridLineColor: '#505053',
  72. tickColor: '#707073',
  73. title: {
  74. style: {
  75. color: textBright
  76. }
  77. }
  78. },
  79. tooltip: {
  80. backgroundColor: 'rgba(0, 0, 0, 0.85)',
  81. style: {
  82. color: textBright
  83. }
  84. },
  85. plotOptions: {
  86. series: {
  87. dataLabels: {
  88. color: textBright
  89. },
  90. marker: {
  91. lineColor: '#333'
  92. }
  93. },
  94. boxplot: {
  95. fillColor: '#505053'
  96. },
  97. candlestick: {
  98. lineColor: 'white'
  99. },
  100. errorbar: {
  101. color: 'white'
  102. },
  103. map: {
  104. nullColor: '#353535'
  105. }
  106. },
  107. legend: {
  108. backgroundColor: 'transparent',
  109. itemStyle: {
  110. color: textBright
  111. },
  112. itemHoverStyle: {
  113. color: '#FFF'
  114. },
  115. itemHiddenStyle: {
  116. color: '#606063'
  117. },
  118. title: {
  119. style: {
  120. color: '#D0D0D0'
  121. }
  122. }
  123. },
  124. credits: {
  125. style: {
  126. color: textBright
  127. }
  128. },
  129. labels: {
  130. style: {
  131. color: '#707073'
  132. }
  133. },
  134. drilldown: {
  135. activeAxisLabelStyle: {
  136. color: textBright
  137. },
  138. activeDataLabelStyle: {
  139. color: textBright
  140. }
  141. },
  142. navigation: {
  143. buttonOptions: {
  144. symbolStroke: '#DDDDDD',
  145. theme: {
  146. fill: '#505053'
  147. }
  148. }
  149. },
  150. rangeSelector: {
  151. buttonTheme: {
  152. fill: '#505053',
  153. stroke: '#000000',
  154. style: {
  155. color: '#eee'
  156. },
  157. states: {
  158. hover: {
  159. fill: '#707073',
  160. stroke: '#000000',
  161. style: {
  162. color: textBright
  163. }
  164. },
  165. select: {
  166. fill: '#303030',
  167. stroke: '#101010',
  168. style: {
  169. color: textBright
  170. }
  171. }
  172. }
  173. },
  174. inputBoxBorderColor: '#505053',
  175. inputStyle: {
  176. backgroundColor: '#333',
  177. color: textBright
  178. },
  179. labelStyle: {
  180. color: textBright
  181. }
  182. },
  183. navigator: {
  184. handles: {
  185. backgroundColor: '#666',
  186. borderColor: '#AAA'
  187. },
  188. outlineColor: '#CCC',
  189. maskFill: 'rgba(180,180,255,0.2)',
  190. series: {
  191. color: '#7798BF',
  192. lineColor: '#A6C7ED'
  193. },
  194. xAxis: {
  195. gridLineColor: '#505053'
  196. }
  197. },
  198. scrollbar: {
  199. barBackgroundColor: '#808083',
  200. barBorderColor: '#808083',
  201. buttonArrowColor: '#CCC',
  202. buttonBackgroundColor: '#606063',
  203. buttonBorderColor: '#606063',
  204. rifleColor: '#FFF',
  205. trackBackgroundColor: '#404043',
  206. trackBorderColor: '#404043'
  207. }
  208. };
  209. // Apply the theme
  210. setOptions(H.theme);