Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 4 additions & 7 deletions adafruit_tcs34725.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
"""
import time

import adafruit_bus_device.i2c_device as i2c_device
from adafruit_bus_device import i2c_device
from micropython import const

__version__ = "0.0.0-auto.0"
Expand Down Expand Up @@ -147,12 +147,9 @@ def color_rgb_bytes(self):
blue = int(pow((int((b / clear) * 256) / 255), 2.5) * 255)

# Handle possible 8-bit overflow
if red > 255:
red = 255
if green > 255:
green = 255
if blue > 255:
blue = 255
red = min(red, 255)
green = min(green, 255)
blue = min(blue, 255)
return (red, green, blue)

@property
Expand Down