Skip to content

Commit

Permalink
More intuitive color combinations
Browse files Browse the repository at this point in the history
  • Loading branch information
davazp committed Apr 6, 2012
1 parent ef5adad commit ef0c07b
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions colors.fs
Original file line number Diff line number Diff line change
Expand Up @@ -25,15 +25,17 @@
: fg! attr [ $0f invert ]L and or attr! ;
: bg! 4 lshift attr [ $70 invert ]L and or attr! ;

: blinking attr $80 or attr! ;
: blink attr $80 or attr! ;
: noblink attr [ $80 invert ]L and attr! ;

variable masks
variable light-level
variable background?

: color create , does> @ masks @ or
: color create , does> @
light-level @ 0 > if 8 or endif
background? @ if bg! else fg! endif
background? off
0 masks ! ;
light-level 0! ;

: upon background? on ;

Expand All @@ -44,13 +46,16 @@ variable background?
4 color red
5 color purple
6 color brown
7 color gray
7 color gray*

: light 8 masks ! ;
: dark 0 masks ! ;
: light light-level 1+! ;
: dark light-level 1-! ;

: gray
0 light-level @ < if dark gray* else light black then ;

: yellow light brown ;
: white light gray ;
: white light gray* ;
: magenta light purple ;

\ colors.fs ends here

0 comments on commit ef0c07b

Please sign in to comment.