RGBGreyScale
ColourValue = RGBGreyScale(RgbColour)
 
Parameters:

    RgbColour = The RGB colour value to convert
Returns:

    ColourValue = The grey scale equivalent of the input colour value
 

     The RGBGreyScale() function returns a RGB colour value converted to a grey scale equivalent. This is generally useful when you need to compute how bright a colour is.



FACTS:


     * A colour returned from RGBGreyScale will have all it's R,G,B channel levels et to the same value. So R channel level will equal B as would the G in turn will equal B.




Mini Tutorial:


      This example draws a random patch of dots, then repeats this process but this time coverting the dot colours to grey scales.

  
  
  
; Seed the Random Number generator
  Randomize 47
  
; Draw 5000 random coloured dots
; within the the left hand section of
; the screen.
  For lp =0 To 5000
     DotC Rnd(100),Rnd(100),RndRGB()
  Next
  
  
; ReSeed the Random Number generator
  Randomize 47
  
; Draw the same set of dots, but this
; time in grey scale colours.
  For lp =0 To 5000
     DotC 200+Rnd(100),Rnd(100),RgbGreyScale(RndRGB())
  Next
  
; Show the Screen and wait for a key press
  Sync
  WaitKey
  



 
Related Info: ARGB | RGB | RgbAlphaAdd | RgbAlphaAnd | RGBAlphaBlend | RgbAlphaMult | RgbAlphaOr | RgbAlphaSub | RgbAlphaXOr | RGBFade :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com