Skip to content

What kind of color is this? #548

Answered by uzlonewolf
RYoder97 asked this question in Q&A
Oct 19, 2024 · 2 comments · 3 replies
Discussion options

You must be logged in to vote

00ac03b103ce

0x00ac = 172 (H, 0-360)
0x03b1 = 945 = 94.5% (S, 0.0-100.0%)
0x03ce = 974 = 97.4% (V, 0.0-100.0%)

Even if you don't instantiate a BulbDevice object you can still use the class functions:

import tinytuya

hexvalue = '00ac03b103ce'

print( tinytuya.BulbDevice._hexvalue_to_hsv(hexvalue, bulb='B') )
# (0.4777777777777778, 0.945, 0.974)

print( tinytuya.BulbDevice._hexvalue_to_rgb(hexvalue, bulb='B') )
# (13, 248, 217)

print( tinytuya.BulbDevice._rgb_to_hexvalue(255, 128, 64, bulb='B') )
# 001402ed03e8

@jasonacox What do you think of promoting those 3 functions to officially supported?

Replies: 2 comments 3 replies

Comment options

You must be logged in to vote
1 reply
@RYoder97
Comment options

Comment options

You must be logged in to vote
2 replies
@jasonacox
Comment options

@RYoder97
Comment options

Answer selected by RYoder97
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants