Skip to content

Commit

Permalink
Hotfix 2.4.1
Browse files Browse the repository at this point in the history
- Fixed a bug where `Style` was added to `segments`.
  • Loading branch information
romanin-rf committed Dec 1, 2023
1 parent 8810ea9 commit a47549e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 9 deletions.
2 changes: 1 addition & 1 deletion pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
[tool.poetry]
name = "ripix"
version = "2.4.0"
version = "2.4.1"
description = "A Rich-compatible library for writing pixel images and ASCII art to the terminal."
authors = ["Darren Burns <[email protected]>", "Romanin <[email protected]>"]
repository = "https://github.com/romanin-rf/ripix"
Expand Down
12 changes: 4 additions & 8 deletions ripix/pixel.py
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,8 @@ def _segments_from_image(
this_row = []
for x in range(height):
r, g, b, a = image.getpixel((x, y))
if a > 0:
this_row.append(Style.parse(f"on rgb({r},{g},{b})"))
else:
this_row.append(null_style)
style = Style.parse(f"on rgb({r},{g},{b})") if a > 0 else null_style
this_row.append(Segment(style))
this_row.append(Segment("\n", null_style))
segments += this_row
return segments
Expand Down Expand Up @@ -154,10 +152,8 @@ async def _segments_from_image(
this_row = []
for x in range(height):
r, g, b, a = image.getpixel((x, y))
if a > 0:
this_row.append(Style.parse(f"on rgb({r},{g},{b})"))
else:
this_row.append(null_style)
style = Style.parse(f"on rgb({r},{g},{b})") if a > 0 else null_style
this_row.append(Segment(style))
this_row.append(Segment("\n", null_style))
segments += this_row
return segments
Expand Down

0 comments on commit a47549e

Please sign in to comment.