home *** CD-ROM | disk | FTP | other *** search
/ Amiga ISO Collection / AmigaUtilCD2.iso / Misc / HYPERBOOK2.DMS / in.adf / Macros / SavePageColors < prev    next >
Encoding:
Text File  |  1990-09-23  |  527 b   |  19 lines

  1. /* SavePageColors - saves the current color set as RGB triplets in the file
  2.    ram:colors. All 16 colors available are saved even if the page uses a
  3.    smaller palette. This is done by modifying the display before reading
  4.    the colors, then changing it back afterwards.
  5. */
  6.  
  7. if open(outfile, 'ram:colors', 'write') then do
  8.    n = getpagecolors(':')
  9.    call setpagecolors(':',16)
  10.  
  11.    do i = 0 to 15
  12.       call writeln(outfile, '$' || right(d2x(getpagergb(':',i)),4,'0'))
  13.       end
  14.  
  15.    end
  16.  
  17. call setpagecolors(':',n)
  18. say 'Done!'
  19.