Rotate Hue in C#
I'm looking to replicate the CSS3 hue rotation behaviour found here
original image

image with hue rotated 180deg

I can already accurately convert an RGB value to a HSL value and back again but I'm not sure what the mathematical function to apply to the hue component to replicate the output is.