Logic Machine Forum
ColorSpace Library - Printable Version

+- Logic Machine Forum (https://forum.logicmachine.net)
+-- Forum: LogicMachine eco-system (https://forum.logicmachine.net/forumdisplay.php?fid=1)
+--- Forum: Scripting (https://forum.logicmachine.net/forumdisplay.php?fid=8)
+--- Thread: ColorSpace Library (/showthread.php?tid=5127)



ColorSpace Library - emme - 02.12.2023

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

.gz   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 Tongue Tongue 
hope this could help!!

ciao
M