The Colors package implements commands for manipulating and converting color values (Tk names, RGB, HSV). Not sure of the original source but a copy is available from [L1 ].