RgbAlpha50
NewColour = RgbAlpha50(RGBValue1, RGBValue2)
 
Parameters:

    RGBValue1 = An RGB Colour Value
    RGBValue2 = An RGB Colour Value
Returns:

    NewColour = The result colour after this operation
 

      The RgbAlpha50() function performs a 50/50 Alpha Blend between the RGB channels of two colours. So the colours are merged together.



FACTS:


      * You can find some more detailed examples in the Projects/Examples/Colours folder of your PlayBASIC installation.



Mini Tutorial:


      This example shows the effect of the Rgb Alpha 50 colour operation.

  
  ColourA=RGB(100,110,120)
  ColourB=RGB(50,60,70)
  
  PrintHEading("Rgb Alpha 50")
  PrintColour( ColourA)
  PrintColour( ColourB)
  PrintColour( rgbalpha50(ColourA,ColourB))
  
  // Demostrate this visually
  BoxC 100,100,200,200,true,ColourA
  BoxC 150,150,250,250,true,ColourB
  BoxC 150,150,200,200,true,rgbalpha50(ColourA,ColourB)
  
  
  Sync
  WaitKey
  
  
  
; Split the colour into and R,G,B fields and display it
Function PrintColour(ThisColour)
  r=RgbR(ThisCOlour)
  g=RgbG(ThisCOlour)
  b=RgbB(ThisCOlour)
  Print  Str$(r)+","+Str$(g)+","+Str$(b)
EndFunction
  
  
; Display a heading
Function PrintHEading(Heading$)
  Print ""
  Print AutoCaps$(Heading$)
EndFunction
  
  




This example would output.

  
  
  RGB Alpha 50
  100,110,120
  50,60,70
  75,85,95
  
  

 
Related Info: RGB | RgbAlphaAdd | RgbAlphaAnd | RGBAlphaBlend | RgbAlphaMult | RgbAlphaOr | RgbAlphaSub | RgbAlphaXOr | RGBB | RGBFade | RGBG | RGBGreyScale | RGBR | RndRGB :
 


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