Enum tetra::graphics::BlendMode[][src]

pub enum BlendMode {
    Alpha(BlendAlphaMode),
    Add(BlendAlphaMode),
    Subtract(BlendAlphaMode),
    Multiply,
}
Expand description

The different ways of blending colors.

The active blend mode will be used to determine how drawn content will be blended with the screen (or with a Canvas, if one is active).

For modes where the alpha component of the color can affect the output, an additional BlendAlphaMode parameter is provided, which determines if the colour should be multiplied by its alpha before blending.

Variants

The alpha of the drawn content will determine its opacity.

This is the default behaviour.

Tuple Fields of Alpha

0: BlendAlphaMode

The pixel colors of the drawn content will be added to the pixel colors already in the target. The target’s alpha will not be affected.

Tuple Fields of Add

0: BlendAlphaMode
Subtract(BlendAlphaMode)

The pixel colors of the drawn content will be subtracted from the pixel colors already in the target. The target’s alpha will not be affected.

Tuple Fields of Subtract

0: BlendAlphaMode
Multiply

The pixel colors of the drawn content will be multiplied with the pixel colors already in the target. The alpha component will also be multiplied.

Trait Implementations

Returns a copy of the value. Read more

Performs copy-assignment from source. Read more

Formats the value using the given formatter. Read more

Returns the “default value” for a type. Read more

This method tests for self and other values to be equal, and is used by ==. Read more

This method tests for !=.

Auto Trait Implementations

Blanket Implementations

Gets the TypeId of self. Read more

Immutably borrows from an owned value. Read more

Mutably borrows from an owned value. Read more

Performs the conversion.

Performs the conversion.

The resulting type after obtaining ownership.

Creates owned data from borrowed data, usually by cloning. Read more

🔬 This is a nightly-only experimental API. (toowned_clone_into)

recently added

Uses borrowed data to replace owned data, usually by cloning. Read more

The type returned in the event of a conversion error.

Performs the conversion.

The type returned in the event of a conversion error.

Performs the conversion.