DVUI

opacity

Multiply the current opacity with mult, usually between 0 and 1

Parameters

#
self:Color
Color
mult:f32
f32

Source

Implementation

#
pub fn opacity(self: Color, mult: f32) Color {
    if (mult > 1) return self;
    return Color{
        .r = self.r,
        .g = self.g,
        .b = self.b,
        .a = @trunc(std.math.clamp(@as(f32, self.a) * mult, 0, 255)),
    };
}