JS function to calculate complementary colour?
问题 Does anybody know, off the top of your heads, a Javascript solution for calculating the complementary colour of a hex value? There is a number of colour picking suites and palette generators on the web but I haven't seen any that calculate the colour live using JS. A detailed hint or a snippet would be very much appreciated. 回答1: Parsed through http://design.geckotribe.com/colorwheel/ // Complement temprgb={ r: 0, g: 0xff, b: 0xff }; // Cyan temphsv=RGB2HSV(temprgb); temphsv.hue=HueShift