/* Harold H. Ipolyi © 1998 =====README===== Short: generate rgb color test html Uploader: ipolyi@ev1.net (Harold H. Ipolyi) Author: Harold H. Ipolyi Type: util/rexx LastRev: 30 Aug 1998 Platform: Amiga, AmigaOS, & ARexx Porting: none, but this REXX script could be reworked for other Platforms
_____________________________________________________________________________

 to INSTALL: just drag rgb.rexx & its ICON into REXX:
_____________________________________________________________________________

Prerequisites:	ARexx (of course :)
		rexxsupport.library	( WB disk:libs     )
		rexxarplib.library	( aminet:util/rexx )
		HTML/WWW browser (AMosaic, Mosaic, ... )

=====README=====

=====History=====

Release History:

 30 Aug 1998 á original

=====History=====
*/

/* add libraries */
libs = 'rexxsupport.library rexxarplib.library'
DO i = 1 TO Words(libs)
 lib = Word(libs,i)
 if ~Show('Lib',lib) then do
  if EXISTS('LIBS:'lib) then call addlib lib, 0, -30
  else do
   say ' '
   say 'ERROR: cannot find' lib 'in LIBS:'
   say ' '
   if lib = 'rexxsupport.library' then do
    say ' please copy rexxsupport.library from WorkBench disk:libs'
    end
   else do
    say ' please get rexxarplib.library from aminet:util/rexx'
    end
   say ' '
   AskExit()
   end
  end
 end i

if EXISTS('rexx:rgb.rexx') then rexxdir = "rexx:"
else rexxdir = ""

do files = 1 to 4

 Open('rgbtxt','Sys:html/rgb/txt/rgb'files'.txt','r')

 Open('rgbhtml','Sys:html/rgb/rgb'files'.html','w')

 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','rgb colors')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')
 WriteLn('rgbhtml','')

 DO While ~EOF('rgbtxt')
  rgbline = ReadLn('rgbtxt')

  Parse VAR rgbline reddec greendec bluedec name

  if rgbline ~= '' then do

   redhex = D2X(reddec)
   greenhex = D2X(greendec)
   bluehex = D2X(bluedec)

   name = Strip(name)

   if ( length(redhex) = 1 ) then redhex = '0'redhex
   if ( length(greenhex) = 1 ) then greenhex = '0'greenhex
   if ( length(bluehex) = 1 ) then bluehex = '0'bluehex

   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','') 
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')

   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')
   WriteLn('rgbhtml','')

   WriteLn('rgbhtml','')

   end

  end


 WriteLn('rgbhtml','
definitionbrowserhex
redgreenbluecolor nameopinionvia hex:rr gg bbcomponents
'reddec''greendec''bluedec''name'fontfont'redhex''greenhex''bluehex''redhex''greenhex''bluehex'
') close('rgbtxt') close('rgbhtml') end