02.12.2023, 18:39
Working with IoT and other gateways I use to handle different color schemas
RGB the most used, but Homekit uses HSV and WLED use HEX
so I wrote a library to convert:
RGB to XYZ (D65/2°) and viceversa
RGB to CMY and viceversa
RGB to HSV and vivecersa
you can upload it and use the functions:
RGB2XYZ(R,G,B) : provide R, G and B (0~255) return 3 variables: X, Y and Z (0~100)
XYZ2RGB(X,Y,Z): provice X, Y and Z (0~100) and return R, G and B (0~255)
other funtions are:
RGB2HSV(R, G, B)
HSV2RGB(H,S,V)
RGB2CMY(R,G,B)
CMY2RGB(C,M,Y)
there is function help('{funcname}') also, unfortunately only in italian
hope this could help!!
ciao
M
RGB the most used, but Homekit uses HSV and WLED use HEX
so I wrote a library to convert:
RGB to XYZ (D65/2°) and viceversa
RGB to CMY and viceversa
RGB to HSV and vivecersa
colorSpace_v1_0.tar.gz (Size: 2.63 KB / Downloads: 12)
you can upload it and use the functions:
RGB2XYZ(R,G,B) : provide R, G and B (0~255) return 3 variables: X, Y and Z (0~100)
XYZ2RGB(X,Y,Z): provice X, Y and Z (0~100) and return R, G and B (0~255)
other funtions are:
RGB2HSV(R, G, B)
HSV2RGB(H,S,V)
RGB2CMY(R,G,B)
CMY2RGB(C,M,Y)
there is function help('{funcname}') also, unfortunately only in italian
hope this could help!!
ciao
M