Factor theme colors are now referenced by name.
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.db4
parent
9c7d45e08a
commit
ab7e2fc69b
|
@ -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: } ;
|
||||
|
|
|
@ -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>
|
||||
|
||||
|
|
|
@ -0,0 +1,5 @@
|
|||
! Factor UI theme colors
|
||||
227 226 219 FactorLightTan
|
||||
172 167 147 FactorDarkTan
|
||||
81 91 105 FactorLightSlateBlue
|
||||
55 62 72 FactorDarkSlateBlue
|
|
@ -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
|
||||
|
|
|
@ -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-background COLOR: FactorLightTan
|
||||
CONSTANT: button-clicked-background COLOR: FactorDarkSlateBlue
|
||||
|
||||
CONSTANT: button-clicked-background
|
||||
T{ rgba
|
||||
f
|
||||
0.2156862745098039
|
||||
0.2431372549019608
|
||||
0.2823529411764706
|
||||
1.0
|
||||
}
|
||||
|
||||
: <border-button-pen> ( -- pen )
|
||||
"button" button-background button-clicked-background
|
||||
<border-button-state-pen> dup
|
||||
|
|
|
@ -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>
|
||||
|
|
|
@ -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
|
Loading…
Reference in New Issue