









Voici une petite fonction qui va convertir des code RGB en hexadecimal :
function rgb2hex(r,g,b) { var hexVal = function(n) { var data = "0123456789ABCDEF"; if (n==null) return "00"; n=parseInt(n); if (n==0 || isNaN(n)) return "00"; n=Math.round(Math.min(Math.max(0,n),255)); return data.charAt((n-n%16)/16) + data.charAt(n%16); } return hexVal(r)+hexVal(g)+hexVal(b); }
Discussion
Bonjour Sur le site http://spotmag.free.fr vous trouverez une animation flash permettant de choisir les couleurs et générant les codes RGV correspondants.
Au revoir