on master help sign in
fix limitAttrForDisplay - #46
commit2b54cb9d2bdd7e733d6d18ff0507c77de5f86d49 authorCorey O'Connor <coreyoconnor@gmail.com> dateFri 15 Aug 2014, 00:09 (12 years ago) parentb797c48
2 files changed+4−4
src/Graphics/Vty/Output/Interface.hs+3−3 src/Graphics/Vty/Output/TerminfoBased.hs+1−1
src/Graphics/Vty/Output/Interface.hs+3−3
@@ -247,9 +247,9 @@ limitAttrForDisplay t attr
247247 | otherwise = SetTo $ ISOColor v
248248 clampColor' (Color240 v)
249249 -- TODO: Choose closes ISO color?
250− | contextColorCount t < 8 = Default
251− | contextColorCount t < 16 = Default
252− | contextColorCount t == 240 = SetTo $ Color240 v
250+ | contextColorCount t < 8 = Default
251+ | contextColorCount t < 16 = Default
252+ | contextColorCount t <= 256 = SetTo $ Color240 v
253253 | otherwise
254254 = let p :: Double = fromIntegral v / 240.0
255255 v' = floor $ p * (fromIntegral $ contextColorCount t)
src/Graphics/Vty/Output/TerminfoBased.hs+1−1
@@ -260,7 +260,7 @@ terminfoDisplayContext tActual terminfoCaps r = return dc
260260-- This equation implements the above logic.
261261--
262262-- \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`
264264--
265265-- \todo This assumes that fewer state changes, followed by fewer bytes, is what to optimize. I
266266-- haven't measured this or even examined terminal implementations. *shrug*