rgb2html

The rgb2html function is used to create a web color string from a specified rgb color. This function is contained in the SYSCLASS library. Standalone apps must include the LIBRARY SYSCLASS statement at the top of their source code. Active Pages automatically include the SYSCLASS library.

Category: Color


Syntax:
    string = rgb2html( rgb ColorValue )


Description:

The rgb2html function converts a numeric rgb color to a web-based color string of the format #RRGGBB, where RR is the hexadecimal representation of the red component of the color, GG is the green portion, and BB is the blue color value.


Platforms:
    Windows, DOS, Internet Active Pages


Example:
  LIBRARY sysclass.flb
  
  rgbColor = rgb( 0, 128, 255 )
  clrString = rgb2html( rgbColor )

  // or,
    
  clrString = rgb2html( rgb( 0, 128, 255 ) )


  // or, in an active page,
  
  <[
  	redgreen = rgb( 255, 255, 0 )
  	greenblue = rgb( 0, 255, 255 )
  	redblue = rgb( 255, 0, 255 )
  ]>
    
  <body bgcolor="<[ ! rgb2html( redgreen ) ]>" margin=0>

  // this resolves to: <body bgcolor="#FFFF00" margin=0>

  
(c) 2000-2001 by West Coast Web Adventures, Inc., All Rights Reserved