themes.qsrc 8.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325
  1. # themes
  2. if $theme['name'] = '': $theme['name'] = 'Dynamic' & gs 'themes', 'set_dynamic'
  3. !! ------------------------------------------------------------------------------
  4. !! ---------------------------------- Helpers -----------------------------------
  5. !! ------------------------------------------------------------------------------
  6. !! picks an alternating color between table_bg and table_bg_alt
  7. ! use: $temp_bcolor = func('themes', 'alt_color', $temp_bcolor)
  8. ! when you pass blank $temp_bcolor ('') it will return table_bg
  9. ! when you pass $temp_bcolor again it will return table_bg_alt
  10. if $ARGS[0] = 'alt_color':
  11. $result = iif($ARGS[1] = $theme['table_bg'], $theme['table_bg_alt'], $theme['table_bg'])
  12. end
  13. !! wrapper for above func to use with wardrobe system
  14. !! does the same thing but it sets $temp_bcolor instead of returning a value
  15. ! use: gs 'themes', 'clothing'
  16. if $ARGS[0] = 'clothing':
  17. $temp_bcolor = func('themes', 'alt_color', $temp_bcolor)
  18. end
  19. !! ------------------------------------------------------------------------------
  20. !! ---------------------------------- Routing -----------------------------------
  21. !! ------------------------------------------------------------------------------
  22. if $ARGS[0] = 'outdoors':
  23. gs 'themes', 'apply', $ARGS[0]
  24. elseif $ARGS[0] = 'indoors':
  25. gs 'themes', 'apply', $ARGS[0]
  26. gs 'indoors'
  27. elseif $ARGS[0] = 'apply':
  28. if $theme['type'] = 'dynamic':
  29. theme['old_is_dark'] = theme['is_dark']
  30. gs 'themes', 'apply_dynamic', $ARGS[1]
  31. if theme['old_is_dark'] ! theme['is_dark']:
  32. theme['old_is_dark'] = theme['is_dark']
  33. clear
  34. $stat_msg = ''
  35. gs 'stat_display'
  36. end
  37. else
  38. gs 'themes', 'apply_static', $ARGS[1]
  39. end
  40. end
  41. !! ------------------------------------------------------------------------------
  42. !! ----------------------------------- Apply ------------------------------------
  43. !! ------------------------------------------------------------------------------
  44. if $ARGS[0] = 'apply_dynamic':
  45. if $ARGS[1] = 'indoors':
  46. theme['is_dark'] = 0
  47. theme['bcolor'] = rgb(255, 255, 255)
  48. theme['lcolor'] = rgb(106, 90, 205)
  49. $theme['bcolor'] = "#FFFFFF"
  50. $theme['lcolor'] = "#6A5ACD"
  51. elseif (DayStage = 6) or (DayStage = 1):
  52. ! sunrise or morning
  53. theme['is_dark'] = 0
  54. theme['bcolor'] = rgb(210, 210, 255)
  55. theme['lcolor'] = rgb(40, 40, 255)
  56. $theme['bcolor'] = "#D2D2FF"
  57. $theme['lcolor'] = "#2828FF"
  58. elseif (DayStage = 2):
  59. ! day
  60. theme['is_dark'] = 0
  61. theme['bcolor'] = rgb(255, 255, 255)
  62. theme['lcolor'] = rgb(106, 90, 205)
  63. $theme['bcolor'] = "#FFFFFF"
  64. $theme['lcolor'] = "#6A5ACD"
  65. elseif (DayStage = 3):
  66. ! evening
  67. theme['is_dark'] = 0
  68. theme['bcolor'] = rgb(226, 169, 169)
  69. theme['lcolor'] = rgb(56, 90, 205)
  70. $theme['bcolor'] = "#E2A9A9"
  71. $theme['lcolor'] = "#385ACD"
  72. elseif (DayStage = 4):
  73. ! sunset
  74. theme['is_dark'] = 1
  75. theme['bcolor'] = rgb(BColorBase, BColorBase - BColorBase / 4, BColorBase - BColorBase / 4)
  76. theme['lcolor'] = rgb(110, 200, 200)
  77. $theme['bcolor'] = func('shortgs', 'rgb_to_hex', bcolor)
  78. $theme['lcolor'] = "#6EC8C8"
  79. else
  80. ! Stage 5 - night
  81. theme['is_dark'] = 1
  82. theme['bcolor'] = rgb(0, 0, 0)
  83. theme['lcolor'] = rgb(106, 90, 205)
  84. $theme['bcolor'] = "#000000"
  85. $theme['lcolor'] = "#6A5ACD"
  86. end
  87. if theme['is_dark'] = 1:
  88. theme['fcolor'] = rgb(255, 255, 255)
  89. $theme['fcolor'] = "#FFFFFF"
  90. theme['table_bg'] = rgb(32, 32, 32)
  91. theme['table_bg_alt'] = rgb(48, 48, 48)
  92. $theme['table_bg'] = "#202020"
  93. $theme['table_bg_alt'] = "#303030"
  94. else
  95. theme['fcolor'] = rgb(0, 0, 0)
  96. $theme['fcolor'] = "#000000"
  97. theme['table_bg'] = rgb(255, 255, 255)
  98. theme['table_bg_alt'] = rgb(230, 242, 255)
  99. $theme['table_bg'] = "#FFFFFF"
  100. $theme['table_bg_alt'] = "#E6F2FF"
  101. end
  102. gs 'themes', 'apply_static'
  103. elseif $ARGS[0] = 'apply_static':
  104. bcolor = theme['bcolor']
  105. fcolor = theme['fcolor']
  106. lcolor = theme['lcolor']
  107. $bcolor = $theme['bcolor']
  108. $fcolor = $theme['fcolor']
  109. $lcolor = $theme['lcolor']
  110. fsize = theme['fsize']
  111. $fname = $theme['fname']
  112. elseif $ARGS[0] = 'reset':
  113. killvar 'theme'
  114. killvar '$theme'
  115. killvar 'bcolor'
  116. killvar 'fcolor'
  117. killvar 'lcolor'
  118. killvar '$bcolor'
  119. killvar '$fcolor'
  120. killvar '$lcolor'
  121. fsize = 12
  122. $fname = 'Tahoma'
  123. theme['is_dark'] = 0
  124. end
  125. !! ------------------------------------------------------------------------------
  126. !! ----------------------------------- Themes -----------------------------------
  127. !! ------------------------------------------------------------------------------
  128. if $ARGS[0] = 'set_dynamic':
  129. gs 'themes', 'reset'
  130. $theme['name'] = 'Dynamic'
  131. $theme['type'] = 'dynamic'
  132. gs 'themes', 'default_palette'
  133. theme['fsize'] = 12
  134. $theme['fname'] = 'Tahoma'
  135. elseif $ARGS[0] = 'set_white':
  136. gs 'themes', 'reset'
  137. $theme['name'] = 'White'
  138. $theme['type'] = 'static'
  139. theme['is_dark'] = 0
  140. gs 'themes', 'default_palette'
  141. theme['bcolor'] = rgb(255, 255, 255)
  142. theme['fcolor'] = rgb(0, 0, 0)
  143. theme['lcolor'] = rgb(106, 90, 205)
  144. $theme['bcolor'] = "#FFFFFF"
  145. $theme['fcolor'] = "#000000"
  146. $theme['lcolor'] = "#6A5ACD"
  147. theme['fsize'] = 12
  148. $theme['fname'] = 'Tahoma'
  149. theme['table_bg'] = rgb(255, 255, 255)
  150. theme['table_bg_alt'] = rgb(230, 242, 255)
  151. $theme['table_bg'] = "#FFFFFF"
  152. $theme['table_bg_alt'] = "#E6F2FF"
  153. elseif $ARGS[0] = 'set_black':
  154. gs 'themes', 'reset'
  155. $theme['name'] = 'Black'
  156. $theme['type'] = 'static'
  157. theme['is_dark'] = 1
  158. gs 'themes', 'default_palette'
  159. theme['bcolor'] = rgb(0, 0, 0)
  160. theme['fcolor'] = rgb(255, 255, 255)
  161. theme['lcolor'] = rgb(90, 180, 200)
  162. $theme['bcolor'] = "#000000"
  163. $theme['fcolor'] = "#FFFFFF"
  164. $theme['lcolor'] = "#5AB4C8"
  165. theme['fsize'] = 12
  166. $theme['fname'] = 'Tahoma'
  167. theme['table_bg'] = rgb(32, 32, 32)
  168. theme['table_bg_alt'] = rgb(48, 48, 48)
  169. $theme['table_bg'] = "#202020"
  170. $theme['table_bg_alt'] = "#303030"
  171. elseif $ARGS[0] = 'set_gray':
  172. gs 'themes', 'reset'
  173. $theme['name'] = 'Modern Grey'
  174. $theme['type'] = 'static'
  175. theme['is_dark'] = 1
  176. gs 'themes', 'default_palette'
  177. theme['bcolor'] = rgb(20, 20, 20)
  178. theme['fcolor'] = rgb(255, 255, 255)
  179. theme['lcolor'] = rgb(90, 180, 200)
  180. $theme['bcolor'] = "#141414"
  181. $theme['fcolor'] = "#FFFFFF"
  182. $theme['lcolor'] = "#5AB4C8"
  183. theme['fsize'] = 12
  184. $theme['fname'] = 'Tahoma'
  185. theme['table_bg'] = rgb(32, 32, 32)
  186. theme['table_bg_alt'] = rgb(48, 48, 48)
  187. $theme['table_bg'] = "#202020"
  188. $theme['table_bg_alt'] = "#303030"
  189. elseif $ARGS[0] = 'set_custom':
  190. gs 'themes', 'reset'
  191. gs 'themes', 'check_custom_vars'
  192. $theme['name'] = 'Custom'
  193. $theme['type'] = $custom_theme['type']
  194. theme['is_dark'] = custom_theme['is_dark']
  195. theme['bcolor'] = custom_theme['bcolor']
  196. theme['fcolor'] = custom_theme['fcolor']
  197. theme['lcolor'] = custom_theme['lcolor']
  198. $theme['bcolor'] = func('shortgs', 'rgb_to_hex', theme['bcolor'])
  199. $theme['fcolor'] = func('shortgs', 'rgb_to_hex', theme['fcolor'])
  200. $theme['lcolor'] = func('shortgs', 'rgb_to_hex', theme['lcolor'])
  201. theme['fsize'] = custom_theme['fsize']
  202. $theme['fname'] = $custom_theme['fname']
  203. theme['table_bg'] = custom_theme['table_bg']
  204. theme['table_bg_alt'] = custom_theme['table_bg_alt']
  205. $theme['table_bg'] = func('shortgs', 'rgb_to_hex', theme['table_bg'])
  206. $theme['table_bg_alt'] = func('shortgs', 'rgb_to_hex', theme['table_bg_alt'])
  207. end
  208. if $ARGS[0] = 'check_custom_vars':
  209. if $custom_theme['type'] = '': $custom_theme['type'] = 'static'
  210. if custom_theme['is_dark'] ! theme['is_dark']: custom_theme['is_dark'] = theme['is_dark']
  211. if custom_theme['bcolor'] = 0: custom_theme['bcolor'] = rgb(20, 20, 20)
  212. if custom_theme['fcolor'] = 0: custom_theme['fcolor'] = rgb(255, 255, 255)
  213. if custom_theme['lcolor'] = 0: custom_theme['lcolor'] = rgb(90, 180, 200)
  214. if custom_theme['fsize'] = 0: custom_theme['fsize'] = 12
  215. if $custom_theme['fname'] = '': $custom_theme['fname'] = 'Tahoma'
  216. if custom_theme['table_bg'] = 0: custom_theme['table_bg'] = rgb(32, 32, 32)
  217. if custom_theme['table_bg_alt'] = 0: custom_theme['table_bg_alt'] = rgb(48, 48, 48)
  218. end
  219. if $ARGS[0] = 'default_palette':
  220. exit
  221. theme['base03'] = rgb(0, 43, 54)
  222. theme['base02'] = rgb(7, 54, 66)
  223. theme['base01'] = rgb(88, 110, 117)
  224. theme['base00'] = rgb(101, 123, 131)
  225. theme['base0'] = rgb(131, 148, 150)
  226. theme['base1'] = rgb(147, 161, 161)
  227. theme['base2'] = rgb(238, 232, 213)
  228. theme['base3'] = rgb(253, 246, 227)
  229. theme['yellow'] = rgb(181, 137, 0)
  230. theme['orange'] = rgb(203, 75, 22)
  231. theme['red'] = rgb(220, 50, 47)
  232. theme['magenta'] = rgb(211, 54, 130)
  233. theme['violet'] = rgb(108, 113, 196)
  234. theme['blue'] = rgb(38, 139, 210)
  235. theme['cyan'] = rgb(42, 161, 152)
  236. theme['green'] = rgb(133, 153, 0)
  237. $theme['base03'] = "#002b36"
  238. $theme['base02'] = "#073642"
  239. $theme['base01'] = "#586e75"
  240. $theme['base00'] = "#657b83"
  241. $theme['base0'] = "#839496"
  242. $theme['base1'] = "#93a1a1"
  243. $theme['base2'] = "#eee8d5"
  244. $theme['base3'] = "#fdf6e3"
  245. $theme['yellow'] = "#b58900"
  246. $theme['orange'] = "#cb4b16"
  247. $theme['red'] = "#dc322f"
  248. $theme['magenta'] = "#d33682"
  249. $theme['violet'] = "#6c71c4"
  250. $theme['blue'] = "#268bd2"
  251. $theme['cyan'] = "#2aa198"
  252. $theme['green'] = "#859900"
  253. end
  254. --- themes ---------------------------------