There was an error while loading. Please reload this page.
1 parent 9abe203 commit 17e411aCopy full SHA for 17e411a
adafruit_tcs34725.py
@@ -242,6 +242,16 @@ def color_rgb_bytes(self):
242
blue = int(pow((int((b/clear) * 256) / 255), 2.5) * 255)
243
return (red, green, blue)
244
245
+ @property
246
+ def color(self):
247
+ """Read the RGB color detected by the sensor. Returns an int with 8 bits per channel.
248
+
249
+ Examples: Red = 16711680 (0xff0000), Green = 65280 (0x00ff00),
250
+ Blue = 255 (0x0000ff), SlateGray = 7372944 (0x708090)
251
+ """
252
+ r, g, b = self.color_rgb_bytes
253
+ return (r << 16) + (g << 8) + b
254
255
256
@property
257
def temperature(self):
0 commit comments