settings
skip menu
change media type
xhtml+xml
change language
deutsch
scripting
dec -> hex

URI: http://www.j-a-b.net/web/hue/code-transformation
last updated: 2009-12-04
© 2002-2009 Contact

up down
Subject Index

Transformation of Colour Codings

RGB - HSL - ColourNames

At times one might want to transform one colour coding into another one. While the relationship between short and long hexadecimal codings is quite obvious as is their relation to absolute RGB values, a transformation to relative values is more complicated. Especially calculation of HSL values from RGB values or vice versa can only be done using some longer and complicated algorithm, and RGB or HSL values of colour names could only be guessed or looked up in a chart.

The following interface allows you to obtain the corresponding values of any valid input (see examples for valid colour ranges). However, due to mathematical rounding some calculated colours might be slightly different from the original colour. The right column shows the appearance of each calculated colour value for comparison.

As of today, HSL values are only rendered in browsers using the Gecko engine (Mozilla 1.6, Firebird 0.7, Firefox 0.8, K-Meleon 0.82) thus the corresponding colour field is left blank in browsers like Internet Explorer or Opera.

The input format of the values can be seen in the examples below. You should neither use the octothorpe (#), nor the keyword rgb, parenthesis or the percent character (%). Input values are case-insensitive.

Colour Code Transformation
input of long hexadecimal values    
f61ad0
  • Min: 000000
  • Max: ffffff
input of short hexadecimal values    
39f
  • Min: 000
  • Max: fff
input of absolute RGB-values    
151,26,237
  • Min: 0,0,0
  • Max: 255,255,255
input of relative RGB-values    
22,45,81
  • Min: 0,0,0
  • Max: 100,100,100
input of HSL-values    
345,60,80
  • Min: 0,0,0
  • Max: 360,100,100
input of colour names    
dimgray
   
Subject Index

CC logo
This page is licensed under a Creative Commons License.