Optimise the half-block codepath slightly.
This commit is contained in:
parent
8076c1d094
commit
e61d5fd947
1 changed files with 3 additions and 3 deletions
|
@ -88,10 +88,10 @@ class ImageWin(Win):
|
||||||
line1 = two_lines[:width * 3]
|
line1 = two_lines[:width * 3]
|
||||||
line2 = two_lines[width * 3:]
|
line2 = two_lines[width * 3:]
|
||||||
self.move(start_y + y, start_x)
|
self.move(start_y + y, start_x)
|
||||||
for x in range(width):
|
for x in range(0, width * 3, 3):
|
||||||
r, g, b = line1[x * 3:(x + 1) * 3]
|
r, g, b = line1[x:x + 3]
|
||||||
top_color = _parse_css_color('#%02x%02x%02x' % (r, g, b))
|
top_color = _parse_css_color('#%02x%02x%02x' % (r, g, b))
|
||||||
r, g, b = line2[x * 3:(x + 1) * 3]
|
r, g, b = line2[x:x + 3]
|
||||||
bot_color = _parse_css_color('#%02x%02x%02x' % (r, g, b))
|
bot_color = _parse_css_color('#%02x%02x%02x' % (r, g, b))
|
||||||
self.addstr('▄', to_curses_attr((bot_color, top_color)))
|
self.addstr('▄', to_curses_attr((bot_color, top_color)))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue