@@ -35,27 +35,27 @@ _colorant2ansi(gr::TransparentColor, colordepth::TermColorDepth) =
3535# 256 colors
3636function _colorant2ansi (col:: AbstractRGB , :: TermColor256 )
3737 r, g, b = clamp01nan (red (col)), clamp01nan (green (col)), clamp01nan (blue (col))
38- r24, g24, b24 = map (c-> round (Int, c * 23 ), (r, g, b))
38+ r24, g24, b24 = map (c-> round (Int, 23 c ), (r, g, b))
3939 if r24 == g24 == b24
4040 # Use grayscales because of higher resultion
4141 # This way even grayscale RGB images look good.
4242 232 + r24
4343 else
44- r6, g6, b6 = map (c-> round (Int, c * 5 ), (r, g, b))
45- 16 + 36 * r6 + 6 * g6 + b6
44+ r6, g6, b6 = map (c-> round (Int, 5 c ), (r, g, b))
45+ 16 + 36 r6 + 6 g6 + b6
4646 end
4747end
4848
49- _colorant2ansi (gr:: Color{<:Any,1} , :: TermColor256 ) = round (Int, 232 + clamp01nan (real (gr)) * 23 )
49+ _colorant2ansi (gr:: Color{<:Any,1} , :: TermColor256 ) = round (Int, 232 + 23 clamp01nan (real (gr)))
5050
5151# 24 bit colors
5252function _colorant2ansi (col:: AbstractRGB , :: TermColor24bit )
5353 r, g, b = clamp01nan (red (col)), clamp01nan (green (col)), clamp01nan (blue (col))
54- map (c-> round (Int, c * 255 ), (r, g, b))
54+ map (c-> round (Int, 255 c ), (r, g, b))
5555end
5656
5757function _colorant2ansi (gr:: Color{<:Any,1} , :: TermColor24bit )
58- r = round (Int, clamp01nan (real (gr)) * 255 )
58+ r = round (Int, 255 clamp01nan (real (gr)))
5959 r, r, r
6060end
6161
0 commit comments