Replaced hard-coded colors with constants

locals-and-roots
nicolas-p 2016-05-03 19:27:03 +02:00 committed by John Benediktsson
parent bea90b8d1f
commit e5698281fb
10 changed files with 35 additions and 51 deletions

View 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

View 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

View 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 )

View 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

View 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 ;

View 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> ;

View 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

View 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{

View 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

View 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