@@ -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)