Skip to content

Commit

Permalink
Update core.py
Browse files Browse the repository at this point in the history
  • Loading branch information
bimac committed Sep 30, 2024
1 parent 4eb42fd commit 5acf882
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions iblqt/core.py
Original file line number Diff line number Diff line change
Expand Up @@ -360,10 +360,10 @@ def data(
row = self._dataFrame.index[index.row()]
col = index.column()
if role == Qt.BackgroundRole:
rgb = self._background[row][col]
return QVariant(QColor.fromRgb(*rgb, self._alpha))
r, g, b = self._background[row][col]
return QVariant(QColor.fromRgb(r, g, b, self._alpha))
if role == Qt.ForegroundRole:
lum: int = self._foreground[row][col]
lum = self._foreground[row][col]
color = QColor('black' if (lum * self._alpha) < 32512 else 'white')
return QVariant(color)
return super().data(index, role)

0 comments on commit 5acf882

Please sign in to comment.