Beta Documentation - Subject to change.

Specifies a blending method.

Fields

  NameDescription
AlphaBlendOverlays the source over the destination using the source alpha to interpolate between the source and destination colors.
ColorPerforms a blend between a new color generated by applying the hue and saturation of the source and the color value of the destination. The new color and the destination color are then interpolated between using the source alpha.
GrayscaleCompute a new color by copying the max of R,G, and B to all three color channels. This new color is then blended with the destination color based on the source alpha.
MultiplyComputes a new color by multiplying each color channel by the source color channel and then interpolating between the new color and the destination color based on the source alpha. Multiply will never brighten a pixel.
NoneNone.
NormalUses the source color value.
OverlayOverlays the source over the destination. If the source alpha is zero destination color will remain unchanged, for any other alpha value the source color replaces the destination.
ScreenCompute a new color by multiplying the inverses of each color channel by the inverse of the source color channel and then inverting the result. The new color is then blended with the destination color based on the source alpha. Screen will never darken a pixel.
UndefinedSpecifies no blending.

Remarks

Blend Mode is used by various UI elements to determine how colors and images are combined. For example, Controls use the blend mode to determine how their background image is combined with the underlying window and then how the background color will be combined on top of that composite.

Examples

This example demonstrates how a control background image can be blended with a color.
Blending a background imageCopy Code
      -- Create a test window to display a status icon.
      testWindow = Turbine.UI.Window();
      testWindow:SetPosition( 100, 100 );
      testWindow:SetSize( 40, 40 );
      testWindow:SetVisible( true );
   
      -- Create a status icon and add it to the window.
      testIcon = Turbine.UI.Control();
      testIcon:SetParent( testWindow );
      testIcon:SetBackground( "Resources/StatusIcon.tga" );
      testIcon:SetSize( 40, 40 );
      testIcon:SetBackColor( Turbine.UI.Color( 1, 1, 0, 0 ) );
   
      testIcon.MouseClick = function( sender, args )
        -- With each click, cycle through the various blend modes.
        statusIcon:SetBlendMode( ( testIcon:GetBlendMode() + 1 ) % 9 );
      end

See Also