DVUI

multiply

Multiply two colors component-wise.

Parameters

#
self:PMA
PMA
other:PMA
PMA

Source

Implementation

#
pub fn multiply(self: PMA, other: PMA) PMA {
        return .{
            .r = @intCast(@divTrunc(@as(u16, self.r) * other.r, 255)),
            .g = @intCast(@divTrunc(@as(u16, self.g) * other.g, 255)),
            .b = @intCast(@divTrunc(@as(u16, self.b) * other.b, 255)),
            .a = @intCast(@divTrunc(@as(u16, self.a) * other.a, 255)),
        };
    }