Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions adafruit_tcs34725.py
Original file line number Diff line number Diff line change
Expand Up @@ -140,8 +140,11 @@ def color(self):
Examples: Red = 16711680 (0xff0000), Green = 65280 (0x00ff00),
Blue = 255 (0x0000ff), SlateGray = 7372944 (0x708090)
"""
r, g, b = self.color_rgb_bytes
return (r << 16) | (g << 8) | b
r, g, b, _c = self.color_raw
scaled_r = r * 255 // 1024
scaled_g = g * 255 // 1024
scaled_b = b * 255 // 1024
return (scaled_r << 16) | (scaled_g << 8) | scaled_b

@property
def active(self):
Expand Down