Class ColorTarget
Represents a color attachment target for rendering operations.
public static class ColorTarget
- Inheritance
-
ColorTarget
- Inherited Members
Remarks
Provides conversion utilities between shader Color4 types and RGBA32 packed format.
Methods
Add(Color4, Color4)
Additive blending - adds source and destination colors.
public static Color4 Add(Color4 src, Color4 dst)
Parameters
Returns
- Color4
Added color (clamped to [0, 1]).
Blend(Color4, Color4)
Blends two colors using alpha blending (source over destination).
public static Color4 Blend(Color4 src, Color4 dst)
Parameters
Returns
- Color4
Blended color.
Remarks
Uses standard alpha blending formula: result = src.rgb * src.a + dst.rgb * (1 - src.a)
BlendRgba32(uint, uint)
Blends a source color onto a destination using packed RGBA32 format.
public static uint BlendRgba32(uint src, uint dst)
Parameters
Returns
- uint
Blended RGBA32 color.
BlendWith(Color4, Color4, BlendMode)
Blends two colors using the specified blend mode.
public static Color4 BlendWith(Color4 src, Color4 dst, BlendMode mode)
Parameters
Returns
- Color4
Blended color.
FromRgba32(uint)
Converts packed RGBA32 format to a Color4 value.
public static Color4 FromRgba32(uint rgba32)
Parameters
rgba32uintPacked RGBA32 color value (0xRRGGBBAA).
Returns
- Color4
Color4 value with components in range [0.0, 1.0].
Multiply(Color4, Color4)
Multiplicative blending - multiplies source and destination colors.
public static Color4 Multiply(Color4 src, Color4 dst)
Parameters
Returns
- Color4
Multiplied color.
Overlay(Color4, Color4)
Overlay blending - combination of multiply and screen based on destination luminance.
public static Color4 Overlay(Color4 src, Color4 dst)
Parameters
Returns
- Color4
Overlay-blended color.
Screen(Color4, Color4)
Screen blending - inverted multiplicative blending.
public static Color4 Screen(Color4 src, Color4 dst)
Parameters
Returns
- Color4
Screen-blended color.
ToRgba32(Color4)
Converts a Color4 value to packed RGBA32 format (0xRRGGBBAA).
public static uint ToRgba32(Color4 color)
Parameters
colorColor4Color4 value with components in range [0.0, 1.0].
Returns
- uint
Packed RGBA32 color value.
Remarks
Color components are clamped to [0.0, 1.0] and converted to 8-bit values.