CMYK is a tricky one, since each device would interpret the colors differently. Had almost decided not to even include it but thought it could be useful at times. Looking around I found a basic formula that most people were using to give a rough idea for the color. I did try another formula that was too far off. Tring to test with converters was interesting, I tested across 5 different converters and came up with 4 different answers one of them was close the red in Hex and RGB was off by one each time. If I had 51 it was 50 from that converter. And converting from CMYK to the others through tests would sometimes be far off. This is mostly from CMYK is an analog for color where RGB and Hex are all digital, conversions of these should always be the same.
For this one I broke apart the colors to 4 boxes and having the trigger activate on the last one, black (K). For both Hex and RGB it they run through the same converter for CMYK, for Hex once it makes the RGB color it then passes it to a function to then create the CMYK. I prefer to do a formula straight from the color to the other without a convert then convert, but there really isn’t a Hex to CMYK formula out there. Since CMYK is an analog color I also limited it to be 2 after the decimal.
Used this site that has web safe colors to do my testing:
Converter App: https://www.lynnamacher.com/converter/