jQuery Convert RGB to Hex Colour Values

Two JavaScript functions to convert rgb colour values to hex colour values and then second one converts hex colours values back to rgb. This is very useful for working with html colours and changing colours dynamically using jQuery.