]> gitweb.factorcode.org Git - factor.git/blob - basis/ui/theme/switching/switching.factor
ui.theme: updates to color scheme.
[factor.git] / basis / ui / theme / switching / switching.factor
1 ! Copyright (C) 2016 Nicolas PĂ©net.
2 ! See http://factorcode.org/license.txt for BSD license.
3 USING: assocs fry hashtables help.stylesheet help.tips io.styles
4 kernel listener namespaces prettyprint.stylesheet sequences
5 ui.theme ui.tools.listener vocabs.prettyprint words ;
6 IN: ui.theme.switching
7
8 : (update-style) ( style color elt -- )
9     '[ _ _ rot ?set-at ] change-global ;
10
11 : update-stylesheet ( -- )
12
13     ! help.stylesheet
14     default-span-style text-color foreground (update-style)
15     link-style link-color foreground (update-style)
16     title-style title-color foreground (update-style)
17     help-path-style help-path-border-color table-border (update-style)
18     heading-style heading-color foreground (update-style)
19     snippet-style snippet-color foreground (update-style)
20     code-style code-background-color page-color (update-style)
21     output-style output-color foreground (update-style)
22     url-style link-color foreground (update-style)
23     warning-style warning-background-color page-color (update-style)
24     warning-style warning-border-color border-color (update-style)
25     deprecated-style deprecated-background-color page-color (update-style)
26     deprecated-style deprecated-border-color border-color (update-style)
27     table-style table-border-color table-border (update-style)
28
29     ! help.tips
30     tip-of-the-day-style tip-background-color page-color (update-style)
31
32     ! ui.tools.listener
33     listener-input-style text-color foreground (update-style)
34     listener-word-style text-color foreground (update-style)
35
36     ! prettyprint.stylesheet
37     { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
38     [ "word-style" word-prop [ dim-color foreground  ] dip set-at ] each
39     base-word-style text-color foreground (update-style)
40     highlighted-word-style highlighted-word-color foreground (update-style)
41     base-string-style string-color foreground (update-style)
42     base-vocab-style dim-color foreground (update-style)
43     stack-effect-style stack-effect-color foreground (update-style)
44
45     ! listener
46     prompt-style prompt-background-color background (update-style)
47     prompt-style text-color foreground (update-style)
48
49     ! vocabs.prettyprint
50     manifest-style vocab-background-color page-color (update-style)
51     manifest-style vocab-border-color border-color (update-style) ;
52
53 : light-mode ( -- )
54     light-theme theme set-global update-stylesheet ;
55
56 : dark-mode ( -- )
57     dark-theme theme set-global update-stylesheet ;