on master help sign in
rename "make240ColorCodeFromRGB" to "rgbColorToColor240"
1125b2fColby Jenn
src/Graphics/Vty/Attributes/Color.hs+1−1
@@ -124,4 +124,4 @@ brightWhite = ISOColor 15
124-- This function is lossy in the sense that we only internally support 240 colors but the
124-- This function is lossy in the sense that we only internally support 240 colors but the
125-- #RRGGBB format supports 16^3 colors.
125-- #RRGGBB format supports 16^3 colors.
126rgbColor :: Integral i => i -> i -> i -> Color
126rgbColor :: Integral i => i -> i -> i -> Color
127−rgbColor r g b = Color240 (make240ColorCodeFromRGB r g b)
127+rgbColor r g b = Color240 (rgbColorToColor240 r g b)
src/Graphics/Vty/Attributes/Color240.hs+3−3
@@ -1,6 +1,6 @@
1-- This header file was generated by ./256colres.pl
1-- This header file was generated by ./256colres.pl
2module Graphics.Vty.Attributes.Color240
2module Graphics.Vty.Attributes.Color240
3− ( make240ColorCodeFromRGB
3+ ( rgbColorToColor240
4 , color240CodeToRGB
4 , color240CodeToRGB
5 )
5 )
6where
6where
@@ -12,8 +12,8 @@ import Text.Printf
12-- 256colres.pl which is forked from xterm 256colres.pl.
12-- 256colres.pl which is forked from xterm 256colres.pl.
13
13
14-- | Create a value in the Color240 set from an RGB triple
14-- | Create a value in the Color240 set from an RGB triple
15−make240ColorCodeFromRGB :: Integral i => i -> i -> i -> Word8
15+rgbColorToColor240 :: Integral i => i -> i -> i -> Word8
16−make240ColorCodeFromRGB r g b
16+rgbColorToColor240 r g b
17 | r < 0 && g < 0 && b < 0 = error "rgbColor with negative color component intensity"
17 | r < 0 && g < 0 && b < 0 = error "rgbColor with negative color component intensity"
18 | r == 8 && g == 8 && b == 8 = 216
18 | r == 8 && g == 8 && b == 8 = 216
19 | r == 18 && g == 18 && b == 18 = 217
19 | r == 18 && g == 18 && b == 18 = 217