on master help sign in
Move color definitions to Color module
commite60958bc2b20c146e5dcdb8171df8e50739d0b69 authorJonathan Daugherty <cygnus@foobox.com> dateSun 22 Jan 2017, 12:43 (10 years ago) parent175c235
2 files changed+43−24
src/Graphics/Vty/Attributes.hs−23 src/Graphics/Vty/Attributes/Color.hs+43−1
src/Graphics/Vty/Attributes.hs−23
@@ -126,29 +126,6 @@ instance Eq v => Monoid ( MaybeDefault v ) where
126126 mappend ( SetTo v ) KeepCurrent = SetTo v
127127 mappend ( SetTo _ ) ( SetTo v ) = SetTo v
128128
129−-- | Standard 8-color ANSI terminal color codes.
130−black, red, green, yellow, blue, magenta, cyan, white :: Color
131−black = ISOColor 0
132−red = ISOColor 1
133−green = ISOColor 2
134−yellow = ISOColor 3
135−blue = ISOColor 4
136−magenta= ISOColor 5
137−cyan = ISOColor 6
138−white = ISOColor 7
139−
140−-- | Bright/Vivid variants of the standard 8-color ANSI
141−brightBlack, brightRed, brightGreen, brightYellow :: Color
142−brightBlue, brightMagenta, brightCyan, brightWhite :: Color
143−brightBlack = ISOColor 8
144−brightRed = ISOColor 9
145−brightGreen = ISOColor 10
146−brightYellow = ISOColor 11
147−brightBlue = ISOColor 12
148−brightMagenta= ISOColor 13
149−brightCyan = ISOColor 14
150−brightWhite = ISOColor 15
151−
152129-- | Styles are represented as an 8 bit word. Each bit in the word is 1
153130-- if the style attribute assigned to that bit should be applied and 0
154131-- if the style attribute should not be applied.
src/Graphics/Vty/Attributes/Color.hs+43−1
@@ -1,4 +1,23 @@
1−module Graphics.Vty.Attributes.Color where
1+module Graphics.Vty.Attributes.Color
2+ ( Color(..)
3+ , black
4+ , red
5+ , green
6+ , yellow
7+ , blue
8+ , magenta
9+ , cyan
10+ , white
11+ , brightBlack
12+ , brightRed
13+ , brightGreen
14+ , brightYellow
15+ , brightBlue
16+ , brightMagenta
17+ , brightCyan
18+ , brightWhite
19+ )
20+where
221
322import Data.Word
423
@@ -56,3 +75,26 @@ import Data.Word
5675-- Seriously, terminal color support is INSANE.
5776data Color = ISOColor !Word8 | Color240 !Word8
5877 deriving ( Eq, Show, Read )
78+
79+-- | Standard 8-color ANSI terminal color codes.
80+black, red, green, yellow, blue, magenta, cyan, white :: Color
81+black = ISOColor 0
82+red = ISOColor 1
83+green = ISOColor 2
84+yellow = ISOColor 3
85+blue = ISOColor 4
86+magenta= ISOColor 5
87+cyan = ISOColor 6
88+white = ISOColor 7
89+
90+-- | Bright/Vivid variants of the standard 8-color ANSI
91+brightBlack, brightRed, brightGreen, brightYellow :: Color
92+brightBlue, brightMagenta, brightCyan, brightWhite :: Color
93+brightBlack = ISOColor 8
94+brightRed = ISOColor 9
95+brightGreen = ISOColor 10
96+brightYellow = ISOColor 11
97+brightBlue = ISOColor 12
98+brightMagenta= ISOColor 13
99+brightCyan = ISOColor 14
100+brightWhite = ISOColor 15