home *** CD-ROM | disk | FTP | other *** search
/ AMOS PD CD / amospdcd.iso / sourcecode / subroutines / colour_to_grey.amos / colour_to_grey.amosSourceCode
AMOS Source Code  |  1978-02-22  |  1KB  |  35 lines

  1. 'This Proc will turn your current picture in to a black and white  
  2. 'picture. It will work very well wih high detailed pictures  
  3. 'but some pictures will not look as good. One Example is 
  4. 'the Amos Picture on the amos_Data disk. This picture will 
  5. 'look terrible as most of the colours are to dark. 
  6. '
  7. ' After testing 24 Pictures the average time to convert was 21 seconds.
  8. ' The biggest time was 38 seconds and the smallest 1 second. 
  9. '
  10. Procedure C0LOUR_TO_GREY
  11.    ' Proc written by Brett George 
  12.    C=0 : Z=0
  13.    Repeat 
  14.       Repeat 
  15.          If Colour(Z)=$0 Then C=True
  16.          If Colour(Z)=$111 Then C=True
  17.          If Colour(Z)=$222 Then C=True
  18.          If Colour(Z)=$333 Then C=True
  19.          If Colour(Z)=$444 Then C=True
  20.          If Colour(Z)=$555 Then C=True
  21.          If Colour(Z)=$666 Then C=True
  22.          If Colour(Z)=$777 Then C=True
  23.          If Colour(Z)=$888 Then C=True
  24.          If Colour(Z)=$999 Then C=True
  25.          If Colour(Z)=$AAA Then C=True
  26.          If Colour(Z)=$BBB Then C=True
  27.          If Colour(Z)=$CCC Then C=True
  28.          If Colour(Z)=$DDD Then C=True
  29.          If Colour(Z)=$EEE Then C=True
  30.          If Colour(Z)=$FFF Then C=True
  31.          If C=0 Then Colour Z,Colour(Z)-1
  32.       Until C
  33.     C=0 : Inc Z
  34.    Until Z=Screen Colour
  35. End Proc