RGBAlphaBlend
ColourValue = RGBAlphaBlend(RgbColourA, RgbColourB, BlendPercent)
 
Parameters:

    RgbColourA = The RGB colour value to blend
    RgbColourB = The RGB colour value to blend
    BlendPercent = The blending percentage between them
Returns:

    ColourValue = The grey scale equivalent of the input colour value
 

      The RGBAlpgaBlend() function will take two input RGB colours, performs an Alpha Blending upon them to return a new colour.

      The Alpha Blending process is nothing more than cross fading from RGBColourA towards RGBColourB. The fading is controlled by the BlendPercent parameter.


      Blend Percentages (0 to 100)

00 = Blend result is completely the RGBColourA
25 = Blend result is 75% RGBColourA and 25% RGBColourB
50 = Blend result is 50% RGBColourA and RGBColourB
75 = Blend result is 75% RGBColourB and 25% RGBColourA
100 = Blend result is completely the RGBColourB



FACTS:

      * None



Mini Tutorial:


      This example draws two overlapping boxes. It then uses RGBAlphaBlend to create the illusion that the overlapping section is transparent, by drawing a cross faded box section in the over lapping section.

  
; Define two colours in variables ColA & ColB
  ColA= RGB(255,0,0)
  ColB=RGB(50,100,200)
  
  Do
     Cls RGB(0,0,0)
     
   ; Draw a box in COLA
     BoxC 0,0,100,100,1,ColA
     
   ; draw another box that overlaps
   ; the first box
     BoxC 50,50,150,150,1,ColB
     
   ; Draw a box over overlapping part of the above tow boxes
   ; with it's colour ping ponging being alpha blended from,
   ; ColA To ColB
     
     Fade#=CosRadius(angle#,50)
     Angle#=WrapAngle(angle#,1)
     BoxC 50,50,100,100,1,RgbAlphaBlend(ColA,ColB,50+Fade#)
     
     
     Sync
  Loop
  



 
Related Info: RGB | RgbAlphaAdd | RgbAlphaAnd | RgbAlphaMult | RgbAlphaOr | RgbAlphaSub | RgbAlphaXOr | RndRGB :
 


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