My complementary and triadic color calculator doesn't work, need help

Here the above as a procedure

and an RGB to HSV convertor procedure

and an HSV to RGB convertor procedure

Finally a procedure, using the two procedures above for HSV, to generate RGB values for ttriadic colours:

and to round things off, an aia that generates the complementary and triad of colours:

compTriad.aia (12.9 KB)