]> gitweb.factorcode.org Git - factor.git/commitdiff
Factor theme colors are now referenced by name.
authorKeith Lazuka <klazuka@gmail.com>
Tue, 8 Sep 2009 19:22:13 +0000 (15:22 -0400)
committerKeith Lazuka <klazuka@gmail.com>
Tue, 8 Sep 2009 19:25:27 +0000 (15:25 -0400)
Added a text file, "factor-colors.txt", which is like "rgb.txt" except it lists the theme colors used in the Factor UI.

Changed url-style color to DodgerBlue4 to match link-style.

basis/colors/constants/constants-docs.factor
basis/colors/constants/constants.factor
basis/colors/constants/factor-colors.txt [new file with mode: 0644]
basis/help/stylesheet/stylesheet.factor
basis/ui/gadgets/buttons/buttons.factor
basis/ui/gadgets/status-bar/status-bar.factor
basis/vocabs/prettyprint/prettyprint.factor

index 49d6fce3a15f0fc5c6de0977db3f7ecfed935f61..73dd0c0ccc468041cabc43bc43a3629d0b5b9f8d 100644 (file)
@@ -23,7 +23,7 @@ HELP: COLOR:
 } ;
 
 ARTICLE: "colors.constants" "Standard color database"
-"The " { $vocab-link "colors.constants" } " vocabulary bundles the X11 " { $snippet "rgb.txt" } " database and provides words for looking up color values."
+"The " { $vocab-link "colors.constants" } " vocabulary bundles the X11 " { $snippet "rgb.txt" } " database and Factor's " { $snippet "factor-colors.txt" } " theme database to provide words for looking up color values by name."
 { $subsection named-color }
 { $subsection named-colors }
 { $subsection POSTPONE: COLOR: } ;
index 98e7d434111339f9e4aea08892a2b45856842938..7c9b3ff5358bc8e23acabdf85eb99ce1df416b9e 100644 (file)
@@ -19,7 +19,9 @@ IN: colors.constants
     [ parse-color ] H{ } map>assoc ;
 
 MEMO: rgb.txt ( -- assoc )
-    "resource:basis/colors/constants/rgb.txt" utf8 file-lines parse-rgb.txt ;
+    "resource:basis/colors/constants/rgb.txt"
+    "resource:basis/colors/constants/factor-colors.txt"
+    [ utf8 file-lines parse-rgb.txt ] bi@ assoc-union ;
 
 PRIVATE>
 
diff --git a/basis/colors/constants/factor-colors.txt b/basis/colors/constants/factor-colors.txt
new file mode 100644 (file)
index 0000000..9d7649a
--- /dev/null
@@ -0,0 +1,5 @@
+! Factor UI theme colors
+227 226 219            FactorLightTan
+172 167 147            FactorDarkTan
+ 81  91 105            FactorLightSlateBlue
+ 55  62  72            FactorDarkSlateBlue
index 1072e23423643953754d98a6b7616b80e0ab194e..6c0b18e8e97160c7c487b08640a41c503da795af 100644 (file)
@@ -33,8 +33,8 @@ H{
     { font-size 18 }
     { font-style bold }
     { wrap-margin 500 }
-    { foreground T{ rgba f 0.216 0.243 0.282 1.0 } }
-    { page-color T{ rgba f 0.94 0.94 0.91 1.0 } }
+    { foreground COLOR: FactorDarkSlateBlue }
+    { page-color COLOR: FactorLightTan }
     { border-width 5 }
 } title-style set-global
 
@@ -70,7 +70,7 @@ H{
 
 SYMBOL: code-style
 H{
-    { page-color T{ rgba f 0.94 0.94 0.91 1.0 } }
+    { page-color COLOR: FactorLightTan }
     { border-width 5 }
     { wrap-margin f }
 } code-style set-global
@@ -81,7 +81,7 @@ H{ { font-style bold } } input-style set-global
 SYMBOL: url-style
 H{
     { font-name "monospace" }
-    { foreground COLOR: blue }
+    { foreground COLOR: DodgerBlue4 }
 } url-style set-global
 
 SYMBOL: warning-style
@@ -108,7 +108,7 @@ H{
 SYMBOL: table-style
 H{
     { table-gap { 5 5 } }
-    { table-border T{ rgba f 0.94 0.94 0.91 1.0 } }
+    { table-border COLOR: FactorLightTan }
 } table-style set-global
 
 SYMBOL: list-style
index c65309e06d85119cc4093fffb2f89aab148a7a55..352190c95fe8418d2e192a5b1ed262d1e3d9cb44 100644 (file)
@@ -119,24 +119,9 @@ PRIVATE>
         [ append theme-image ] tri-curry@ tri
     ] 2dip <tile-pen> ;
 
-CONSTANT: button-background
-    T{ rgba
-         f
-         0.8901960784313725
-         0.8862745098039215
-         0.8588235294117647
-         1.0
-    }
-
-CONSTANT: button-clicked-background
-    T{ rgba
-         f
-         0.2156862745098039
-         0.2431372549019608
-         0.2823529411764706
-         1.0
-    }
-    
+CONSTANT: button-background COLOR: FactorLightTan
+CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
+
 : <border-button-pen> ( -- pen )
     "button" button-background button-clicked-background
     <border-button-state-pen> dup
index e8f0648727049bc23efeb7e48fd5dec5a85b472a..5c4b5d98230900f6b8113ecdac145cb93f5fd07f 100644 (file)
@@ -8,12 +8,12 @@ IN: ui.gadgets.status-bar
 
 : status-bar-font ( -- font )
     sans-serif-font clone
-    T{ rgba f 0.216 0.243 0.282 1.0 } >>background
+    COLOR: FactorDarkSlateBlue >>background
     COLOR: white >>foreground ;
 
 : status-bar-theme ( label -- label )
     status-bar-font >>font
-    T{ rgba f 0.216 0.243 0.282 1.0 } <solid> >>interior ;
+    COLOR: FactorDarkSlateBlue <solid> >>interior ;
 
 : <status-bar> ( model -- gadget )
     1/10 seconds <delay> [ "" like ] <arrow> <label-control>
index 20f7c15293009ff2ef0241b56b3b7626ae3460cb..2813485da3c5d52320fd86a2555f979e7533856d 100644 (file)
@@ -1,8 +1,9 @@
 ! Copyright (C) 2009 Slava Pestov.
 ! See http://factorcode.org/license.txt for BSD license.
-USING: accessors kernel sorting sequences vocabs io io.styles arrays assocs
-namespaces sets parser colors prettyprint.backend prettyprint.sections
-prettyprint.stylesheet vocabs.parser make fry math.order ;
+USING: accessors arrays assocs colors colors.constants fry io
+io.styles kernel make math.order namespaces parser
+prettyprint.backend prettyprint.sections prettyprint.stylesheet
+sequences sets sorting vocabs vocabs.parser ;
 IN: vocabs.prettyprint
 
 : pprint-vocab ( vocab -- )
@@ -85,7 +86,7 @@ PRIVATE>
         "To avoid doing this in the future, add the following forms" print
         "at the top of the source file:" print nl
     ] with-style
-    { { page-color T{ rgba f 0.94 0.94 0.91 1.0 } } }
+    { { page-color COLOR: FactorLightTan } }
     [ manifest get pprint-manifest ] with-nesting
     nl nl
 ] print-use-hook set-global
\ No newline at end of file