Skip to content
This repository was archived by the owner on Apr 20, 2022. It is now read-only.

Commit 6620df4

Browse files
authored
Merge pull request #4 from caternuson/buf_fix
add buf property
2 parents 34a6101 + 466dca1 commit 6620df4

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

adafruit_pypixelbuf.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -95,6 +95,11 @@ def __init__(self, n, buf, byteorder="BGR", brightness=1.0, # pylint: disable=t
9595
for i in range(0, self._pixels * 4, 4):
9696
self._bytearray[i + self._offset] = DOTSTAR_LED_START_FULL_BRIGHT
9797

98+
@property
99+
def buf(self):
100+
"""The brightness adjusted pixel buffer data."""
101+
return bytearray([int(i * self.brightness) for i in self._bytearray])
102+
98103
@staticmethod
99104
def parse_byteorder(byteorder):
100105
"""

0 commit comments

Comments
 (0)