FAQ
 
 
Cover  \ Exhibition  \ Learning  \ Reference  \ Download  \ Discourse   
      Language \ Environment \ Libraries \ Comparison
 
   
   
Abridged (A-Z) \ Complete (A-Z)  
   
  Reference for Processing (BETA) version 91+. If you have a previous version, use the reference included with your software. If you see any errors or have any comments, let us know.  
Name  

hex()

   
Examples  
color c = #ffcc00; 
println(c);          // Prints -13312 
println(hex(c));     // Prints FFFFCC00 
println(hex(c, 6));  // Prints FFCC00 


color c = color(255, 204, 0); 
println(c);          // Prints -13312 
println(hex(c));     // Prints FFFFCC00 
println(hex(c, 6));  // Prints FFCC00 

Description   Converts a byte, char, int, or color to a String containing the equivalent hexadecimal notation. For example color(0, 102, 153, 255) will convert to the String "FF006699". This function can help make your geeky debugging sessions much happier.
   
Syntax  
hex(value)
hex(value, digits)
   
Parameters  
value   byte, char, int, color: value to convert

digits   int: number of digits to return

   
Returns   String
   
Usage   Web & Application
   
Related   unhex()
binary()
unbinary()
 
 






   
 
Updated: Fri Jul 15 16:35:41 PDT 2005
 
 








Creative Commons License
 
  Processing is an open project initiated by Ben Fry and Casey Reas  
  © Info