This commit is contained in:
2026-07-04 09:10:18 -07:00
parent 8e8abc12d8
commit c4d803389c
2 changed files with 5 additions and 7 deletions
BIN
View File
Binary file not shown.
+5 -7
View File
@@ -57,7 +57,7 @@ namespace UwU {
mixed.r = this->lerp8(a.r, b.r, t); mixed.r = this->lerp8(a.r, b.r, t);
mixed.g = this->lerp8(a.g, b.g, t); mixed.g = this->lerp8(a.g, b.g, t);
mixed.b = this->lerp8(a.b, b.b, t); mixed.b = this->lerp8(a.b, b.b, t);
mixed.a = this->lerp8(a.a, b.a, t); mixed.a = this->lerp8(a.a, b.a, t); // maybe the alpha channel should be handled differently?
return mixed; return mixed;
} }
@@ -216,14 +216,14 @@ namespace UwU {
uint8_t xGrad[w]; uint8_t xGrad[w];
uint8_t yGrad[h]; uint8_t yGrad[h];
// determine m and calculate horizontal gradient coefficient // determine m and calculate horizontal gradient coefficients
if (w < 256) { if (w < 256) {
this->gradHigh(w, xGrad); this->gradHigh(w, xGrad);
} else { } else {
this->gradLow(w, xGrad); this->gradLow(w, xGrad);
} }
// determine m and calculate vertical gradient coefficient // determine m and calculate vertical gradient coefficients
if (h < 256) { if (h < 256) {
this->gradHigh(h, yGrad); this->gradHigh(h, yGrad);
} else { } else {
@@ -242,8 +242,6 @@ namespace UwU {
putPixel(x, y, Xmix.r, Xmix.g, Xmix.b, Xmix.a); putPixel(x, y, Xmix.r, Xmix.g, Xmix.b, Xmix.a);
} }
} }
return; return;
} }
@@ -296,7 +294,7 @@ int main(void) {
UwU::Color red = UwU::Color(0xff0000ff); UwU::Color red = UwU::Color(0xff0000ff);
UwU::Color green = UwU::Color(0x00ff00ff); UwU::Color green = UwU::Color(0x00ff00ff);
UwU::Color blue = UwU::Color(0x0000ffff); UwU::Color blue = UwU::Color(0x0000ffff);
UwU::Color alpha = UwU::Color(0xffffff00); UwU::Color alpha = UwU::Color(0x00000000);
printf("r: %u, g:%u, b:%u, a:%u\n", fuchsia.r, fuchsia.g, fuchsia.b, fuchsia.a); printf("r: %u, g:%u, b:%u, a:%u\n", fuchsia.r, fuchsia.g, fuchsia.b, fuchsia.a);
// struct waymini *wm = waymini_create(w, h, on_key, NULL); // struct waymini *wm = waymini_create(w, h, on_key, NULL);
@@ -306,7 +304,7 @@ int main(void) {
draw.rectangle(UwU::Coord2(69, 69), UwU::Coord2(420, 420), fuchsia); draw.rectangle(UwU::Coord2(69, 69), UwU::Coord2(420, 420), fuchsia);
draw.rectangleGradient(UwU::Coord2(200, 200), UwU::Coord2(600, 400), red, blue, blue, red); draw.rectangleGradient(UwU::Coord2(200, 200), UwU::Coord2(600, 400), red, blue, alpha, red);