on master help sign in
fix limitAttrForDisplay - #46
2b54cb9Corey O'Connor
src/Graphics/Vty/Output/Interface.hs+3−3
@@ -247,9 +247,9 @@ limitAttrForDisplay t attr
247 | otherwise = SetTo $ ISOColor v
247 | otherwise = SetTo $ ISOColor v
248 clampColor' (Color240 v)
248 clampColor' (Color240 v)
249 -- TODO: Choose closes ISO color?
249 -- TODO: Choose closes ISO color?
250− | contextColorCount t < 8 = Default
250+ | contextColorCount t < 8 = Default
251− | contextColorCount t < 16 = Default
251+ | contextColorCount t < 16 = Default
252− | contextColorCount t == 240 = SetTo $ Color240 v
252+ | contextColorCount t <= 256 = SetTo $ Color240 v
253 | otherwise
253 | otherwise
254 = let p :: Double = fromIntegral v / 240.0
254 = let p :: Double = fromIntegral v / 240.0
255 v' = floor $ p * (fromIntegral $ contextColorCount t)
255 v' = floor $ p * (fromIntegral $ contextColorCount t)
src/Graphics/Vty/Output/TerminfoBased.hs+1−1
@@ -260,7 +260,7 @@ terminfoDisplayContext tActual terminfoCaps r = return dc
260-- This equation implements the above logic.
260-- This equation implements the above logic.
261--
261--
262-- \todo This assumes the removal of color changes in the display attributes is done as expected
262-- \todo This assumes the removal of color changes in the display attributes is done as expected
263−-- with noColors == True. See `limit_attr_for_display`
263+-- with noColors == True. See `limitAttrForDisplay`
264--
264--
265-- \todo This assumes that fewer state changes, followed by fewer bytes, is what to optimize. I
265-- \todo This assumes that fewer state changes, followed by fewer bytes, is what to optimize. I
266-- haven't measured this or even examined terminal implementations. *shrug*
266-- haven't measured this or even examined terminal implementations. *shrug*