Skip to content

Commit

Permalink
fixes for OSX
Browse files Browse the repository at this point in the history
  • Loading branch information
HDembinski committed May 31, 2021
1 parent 80778f8 commit a09b9d6
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 3 additions & 2 deletions monolens/intro.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,9 +15,10 @@ def __init__(self):
self.setWindowFlag(QtCore.Qt.WindowCloseButtonHint, False)

with open(Path(__file__).parent / ".." / "README.md") as f:
m = re.search("<!-- usage begin -->\n(.+?)\n<!--", f.read(), re.DOTALL)
tx = f.read()
m = re.search("<!-- usage begin -->\n(.+?)\n<!--", tx, re.DOTALL)
usage = m.group(1).split("\n-")
usage = "".join(f"<li>{x}</li>" for x in usage)
usage = "".join(f"<li>{x}</li>" for x in usage if x and not x.isspace())

tx = f"""<h1 align="center">Welcome to Monolens</h1>
<p>Monolens allows you to view part of your screen in grayscale.</p>
Expand Down
2 changes: 2 additions & 0 deletions monolens/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@ def _grayscale(d, s, argb):
sg = s[i, g]
sb = s[i, b]
c = clip(0.299 * sr + 0.587 * sg + 0.114 * sb, 0, 255)
d[i, a] = 255
d[i, r] = c
d[i, g] = c
d[i, b] = c
Expand All @@ -88,6 +89,7 @@ def _colorblindness(d, s, cb, argb):
dr = cb[0, 0] * sr + cb[0, 1] * sg + cb[0, 2] * sb
dg = cb[1, 0] * sr + cb[1, 1] * sg + cb[1, 2] * sb
db = cb[2, 0] * sr + cb[2, 1] * sg + cb[2, 2] * sb
d[i, a] = 255
d[i, r] = clip(dr, 0, 255)
d[i, g] = clip(dg, 0, 255)
d[i, b] = clip(db, 0, 255)
Expand Down

0 comments on commit a09b9d6

Please sign in to comment.