]> gitweb.factorcode.org Git - factor.git/blobdiff - basis/prettyprint/stylesheet/stylesheet.factor
ui.theme: updates to color scheme.
[factor.git] / basis / prettyprint / stylesheet / stylesheet.factor
index 51544e5b3c4a74a32f6f8552d20bb35ce362fbc1..ccdedde73d773546f9d46254c7acd5c515725b59 100644 (file)
@@ -1,15 +1,15 @@
 ! Copyright (C) 2009 Keith Lazuka, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: assocs colors combinators
+USING: assocs colors colors.constants combinators
 combinators.short-circuit hashtables io.styles kernel literals
-namespaces sequences ui.theme words words.symbol ;
+namespaces sequences words words.symbol ;
 IN: prettyprint.stylesheet
 
 <PRIVATE
 
 { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
 [
-    { { foreground $ dim-color } }
+    { { foreground COLOR: gray35 } }
     "word-style" set-word-prop
 ] each
 
@@ -17,39 +17,44 @@ PREDICATE: highlighted-word < word [ parsing-word? ] [ delimiter? ] bi or ;
 
 PRIVATE>
 
+SYMBOL: base-word-style
+H{ } base-word-style set-global
+
 GENERIC: word-style ( word -- style )
 
 M: word word-style
-    [ presented associate ]
-    [ "word-style" word-prop ] bi assoc-union!
-    text-color foreground pick set-at ;
-
-M: highlighted-word word-style
-    call-next-method
-    highlighted-word-color foreground pick set-at ;
+    [ presented base-word-style get clone [ set-at ] keep ]
+    [ "word-style" word-prop ] bi assoc-union! ;
 
-<PRIVATE
+SYMBOL: highlighted-word-style
+H{
+    { foreground COLOR: DarkSlateGray }
+} highlighted-word-style set-global
 
-: colored-presentation-style ( obj color -- style )
-    2 <hashtable> [
-        [ presented foreground ] dip
-        [ set-at ] curry bi-curry@ bi*
-    ] keep ;
+M: highlighted-word word-style
+    call-next-method highlighted-word-style get assoc-union! ;
 
-PRIVATE>
+SYMBOL: base-string-style
+H{
+    { foreground COLOR: LightSalmon4 }
+} base-string-style set-global
 
 : string-style ( str -- style )
-    string-color colored-presentation-style ;
+    presented base-string-style get clone [ set-at ] keep ;
+
+SYMBOL: base-vocab-style
+H{
+    { foreground COLOR: gray35 }
+} base-vocab-style set-global
 
 : vocab-style ( vocab -- style )
-    dim-color colored-presentation-style ;
+    presented base-vocab-style get clone [ set-at ] keep ;
 
 SYMBOL: stack-effect-style
-
 H{
-    { foreground $ stack-effect-color }
+    { foreground COLOR: FactorDarkGreen }
     { font-style plain }
 } stack-effect-style set-global
 
 : effect-style ( effect -- style )
-    presented associate stack-effect-style get assoc-union! ;
+    presented stack-effect-style get clone [ set-at ] keep ;