]> gitweb.factorcode.org Git - factor.git/commitdiff
Replaced hard-coded colors with constants
authornicolas-p <z.nicolas@gmail.com>
Tue, 3 May 2016 17:27:03 +0000 (19:27 +0200)
committerJohn Benediktsson <mrjbq7@gmail.com>
Tue, 10 May 2016 04:40:56 +0000 (21:40 -0700)
basis/help/stylesheet/stylesheet.factor
basis/help/tips/tips.factor
basis/listener/listener.factor
basis/prettyprint/stylesheet/stylesheet.factor
basis/ui/gadgets/editors/editors.factor
basis/ui/gadgets/labeled/labeled.factor
basis/ui/render/render.factor
basis/ui/tools/browser/popups/popups.factor
basis/ui/tools/listener/completion/completion.factor
basis/vocabs/prettyprint/prettyprint.factor

index e125b361f923a37a6a132bd0b03bf3a1a660b330..0b64ae07f2d20fbdb3c93bd2749464cfa000d6d9 100644 (file)
@@ -1,7 +1,7 @@
 ! Copyright (C) 2005, 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: assocs colors.constants fonts fry io.styles kernel literals
-math namespaces sequences ;
+math namespaces sequences ui.gadgets.theme ;
 IN: help.stylesheet
 
 : wrap-margin-full ( -- n )
@@ -36,7 +36,7 @@ H{
 
 SYMBOL: link-style
 H{
-    { foreground COLOR: DodgerBlue4 }
+    { foreground $ link-color }
     { font-style bold }
 } link-style set-global
 
@@ -52,7 +52,7 @@ H{
     { font-size $ font-size-title }
     { font-style bold }
     { wrap-margin $ wrap-margin-full }
-    { foreground COLOR: gray20 }
+    { foreground $ title-color }
     { page-color COLOR: FactorLightTan }
     { inset { 5 5 } }
 } title-style set-global
@@ -61,7 +61,6 @@ SYMBOL: help-path-style
 H{
     { font-size $ default-font-size }
     { table-gap { 5 5 } }
-    { table-border COLOR: FactorLightTan }
 } help-path-style set-global
 
 SYMBOL: heading-style
@@ -69,7 +68,7 @@ H{
     { font-name $ default-sans-serif-font-name }
     { font-size $ font-size-heading }
     { font-style bold }
-    { foreground COLOR: FactorDarkSlateBlue }
+    { foreground $ heading-color }
 } heading-style set-global
 
 SYMBOL: subsection-style
@@ -83,7 +82,7 @@ SYMBOL: snippet-style
 H{
     { font-name $ default-monospace-font-name }
     { font-size $ default-font-size }
-    { foreground COLOR: DarkOrange4 }
+    { foreground $ snippet-color }
 } snippet-style set-global
 
 SYMBOL: code-char-style
@@ -94,7 +93,7 @@ H{
 
 SYMBOL: code-style
 H{
-    { page-color COLOR: FactorLightTan }
+    { page-color $ code-background-color }
     { inset { 5 5 } }
     { wrap-margin f }
 } code-style set-global
@@ -102,27 +101,25 @@ H{
 SYMBOL: output-style
 H{
     { font-style bold }
-    { foreground COLOR: DarkOrange4 }
+    { foreground $ output-color }
 } output-style set-global
 
 SYMBOL: url-style
 H{
     { font-name $ default-monospace-font-name }
-    { foreground COLOR: DodgerBlue4 }
+    { foreground $ url-color }
 } url-style set-global
 
 SYMBOL: warning-style
 H{
-    { page-color COLOR: gray90 }
-    { border-color COLOR: red }
+    { page-color $ warning-background-color }
     { inset { 5 5 } }
     { wrap-margin $ wrap-margin-full }
 } warning-style set-global
 
 SYMBOL: deprecated-style
 H{
-    { page-color COLOR: gray90 }
-    { border-color COLOR: red }
+    { page-color $ warning-background-color }
     { inset { 5 5 } }
     { wrap-margin $ wrap-margin-full }
 } deprecated-style set-global
@@ -135,7 +132,7 @@ H{
 SYMBOL: table-style
 H{
     { table-gap { 5 5 } }
-    { table-border COLOR: FactorTan }
+    { table-border $ line-color }
 } table-style set-global
 
 SYMBOL: list-style
index 29612941a8029517b6546f9caffbb102c05adec6..8fa876a96c5c1dfc3cbc0bfc569123d069b06732 100644 (file)
@@ -1,8 +1,8 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors arrays colors.constants definitions help.markup
-help.stylesheet io io.styles kernel literals namespaces parser random
-sequences ;
+help.stylesheet io io.styles kernel literals namespaces parser
+random sequences ui.gadgets.theme ;
 IN: help.tips
 
 SYMBOL: tips
@@ -30,7 +30,7 @@ SYNTAX: TIP:
 SYMBOL: tip-of-the-day-style
 
 H{
-    { page-color COLOR: lavender }
+    { page-color $ tip-background-color }
     { inset { 5 5 } }
     { wrap-margin $ wrap-margin-full }
 } tip-of-the-day-style set-global
index 8d9ac01d3efce96c4d507151263ffb2696879d0c..067cf0636eb9c43b85b286297be9822beca7e953 100644 (file)
@@ -2,9 +2,10 @@
 ! See http://factorcode.org/license.txt for BSD license.
 USING: accessors colors colors.constants
 combinators.short-circuit compiler.units continuations debugger
-fry io io.styles kernel lexer locals math math.parser namespaces
-parser parser.notes prettyprint sequences sets
-source-files.errors system vocabs vocabs.loader vocabs.parser ;
+fry io io.styles kernel lexer literals locals math math.parser
+namespaces parser parser.notes prettyprint sequences sets
+source-files.errors system ui.gadgets.theme vocabs vocabs.loader
+vocabs.parser ;
 IN: listener
 
 GENERIC: stream-read-quot ( stream -- quot/f )
@@ -16,8 +17,8 @@ GENERIC# prompt. 1 ( stream prompt -- )
 
 M: object prompt.
     nip H{
-        { background T{ rgba f 1 0.7 0.7 1 } }
-        { foreground COLOR: black }
+        { background $ prompt-background-color }
+        { foreground $ text-color }
     } format bl flush ;
 
 : parse-lines-interactive ( lines -- quot/f )
index dd56e34723d465fd45c9b27f96d1eded1d805fdf..b11abc92934b13a5394dda713f1e767538babe0b 100644 (file)
@@ -1,14 +1,12 @@
 ! Copyright (C) 2009 Keith Lazuka, Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: assocs colors colors.constants combinators
+USING: assocs colors combinators
 combinators.short-circuit hashtables io.styles kernel literals
-namespaces sequences words words.symbol ;
+namespaces sequences ui.gadgets.theme words words.symbol ;
 IN: prettyprint.stylesheet
 
 <PRIVATE
 
-CONSTANT: dim-color COLOR: gray35
-
 { POSTPONE: USING: POSTPONE: USE: POSTPONE: IN: }
 [
     { { foreground $ dim-color } }
@@ -27,7 +25,7 @@ M: word word-style
 
 M: highlighted-word word-style
     call-next-method
-    COLOR: DarkSlateGray foreground pick set-at ;
+    highlighted-word-color foreground pick set-at ;
 
 <PRIVATE
 
@@ -40,7 +38,7 @@ M: highlighted-word word-style
 PRIVATE>
 
 : string-style ( str -- style )
-    COLOR: LightSalmon4 colored-presentation-style ;
+    string-color colored-presentation-style ;
 
 : vocab-style ( vocab -- style )
     dim-color colored-presentation-style ;
@@ -48,7 +46,7 @@ PRIVATE>
 SYMBOL: stack-effect-style
 
 H{
-    { foreground COLOR: FactorDarkGreen }
+    { foreground $ stack-effect-color }
     { font-style plain }
 } stack-effect-style set-global
 
index f040136c8bf4e083a173e2c218f8713c7c324a99..ba3d077f5a52ee32c99b123f591fdb259e7d2113 100644 (file)
@@ -609,7 +609,7 @@ TUPLE: field < border editor min-cols max-cols ;
 : field-theme ( gadget -- gadget )
     { 2 2 } >>size
     { 1 0 } >>fill
-    COLOR: gray <solid> >>boundary ; inline
+    field-border-color <solid> >>boundary ; inline
 
 : <field-border> ( gadget -- border )
     border new-border field-theme ;
index c414d2a594a5851de33171ba0bc3867f09888376..9c6b3f208fef2d944c3cd50f3f72d02125f5f962 100644 (file)
@@ -51,7 +51,7 @@ PRIVATE>
     add-content-area ;
 
 : <framed-labeled> ( gadget title color -- labeled )
-    <labeled> COLOR: grey85 <solid> >>boundary ;
+    <labeled> labeled-border-color <solid> >>boundary ;
 
 : <labeled-gadget> ( gadget title -- labeled )
     vertical labeled-gadget new-track with-lines
@@ -62,5 +62,5 @@ PRIVATE>
     { 5 5 } <border>
     content-background <solid> >>interior
     1 track-add
-    COLOR: grey85 <solid> >>boundary
+    labeled-border-color <solid> >>boundary
     { 3 3 } <border> ;
index 60269bc625022609522575491dd8c271e64252f1..f28be2a2ac653dbba1b8b164220a52d906e84f68 100644 (file)
@@ -150,15 +150,3 @@ M: gadget draw-children
             [ draw-gadget ] each
         ] with-scope
     ] [ drop ] if ;
-
-CONSTANT: selection-color T{ rgba f 0.8 0.8 1.0 1.0 }
-
-CONSTANT: panel-background-color
-    T{ rgba f
-        0.7843137254901961
-        0.7686274509803922
-        0.7176470588235294
-        1.0
-    }
-
-CONSTANT: focus-border-color COLOR: dark-gray
index c792608e7007c2ec4586a414576fd1f1f70804f2..d4f01fd7950d5151bbcdb9abc555d62464040da8 100644 (file)
@@ -32,7 +32,7 @@ TUPLE: links-popup < wrapper ;
         30 >>max-cols ;
 
 : <links-popup> ( model quot title -- gadget )
-    [ <links-table> COLOR: white <solid> >>interior ] dip
+    [ <links-table> content-background <solid> >>interior ] dip
     popup-color <labeled> links-popup new-wrapper ;
 
 links-popup H{
index 008f9ee81865aaf1bdf4bdf9f61b03be3a3242a4..39ee58ff22c999b8ce93e2aa3fb90640f7662174 100644 (file)
@@ -148,7 +148,7 @@ GENERIC# accept-completion-hook 1 ( item popup -- )
         dup '[ _ accept-completion ] >>action ;
 
 : <completion-scroller> ( completion-popup -- scroller )
-    table>> <scroller> COLOR: white <solid> >>interior ;
+    table>> <scroller> content-background <solid> >>interior ;
 
 : <completion-popup> ( interactor completion-mode -- popup )
     [ vertical completion-popup new-track ] 2dip
index c180beba90421230a416caa5f31cfc6d74829505..480df1a36893fff50b1956d891fa99a4322edd28 100644 (file)
@@ -1,9 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors arrays assocs colors colors.constants fry io
-io.styles kernel make math.order namespaces parser
+USING: accessors arrays assocs colors fry io
+io.styles kernel literals make math.order namespaces parser
 prettyprint.backend prettyprint.sections prettyprint.stylesheet
-sequences sets sorting vocabs vocabs.parser ;
+sequences sets sorting ui.gadgets.theme vocabs vocabs.parser ;
 FROM: io.styles => inset ;
 IN: vocabs.prettyprint
 
@@ -91,8 +91,8 @@ PRIVATE>
         "at the top of the source file:" print nl
     ] with-style
     {
-        { page-color COLOR: FactorLightTan }
-        { border-color COLOR: FactorDarkTan }
+        { page-color $ vocab-background-color }
+        { border-color $ vocab-border-color }
         { inset { 5 5 } }
     } [ manifest get pprint-manifest ] with-nesting
     nl nl