From b9098844b13be73c8247a20475e65b0a93204e64 Mon Sep 17 00:00:00 2001
From: Elias Batek <desisma@heidel.beer>
Date: Sun, 13 Oct 2024 19:15:03 +0200
Subject: [PATCH] Refactor rgba(ubyte,ubyte,ubyte,float)

---
 pixmappaint.d | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/pixmappaint.d b/pixmappaint.d
index e7556bd..71fae49 100644
--- a/pixmappaint.d
+++ b/pixmappaint.d
@@ -364,9 +364,8 @@ static assert(Pixel.sizeof == uint.sizeof);
 	}
 
 	///
-	Pixel rgba(ubyte r, ubyte g, ubyte b, float aPct)
-	in (aPct >= 0 && aPct <= 1) {
-		return Pixel(r, g, b, castTo!ubyte(aPct * 255));
+	Pixel rgba(ubyte r, ubyte g, ubyte b, float aPct) {
+		return Pixel(r, g, b, percentageDecimalToUInt8(aPct));
 	}
 
 	///