+
+static uint32_t lerp_rgb(int r0, int g0, int b0, int r1, int g1, int b1, int32_t t)
+{
+ int r = XLERP(r0, r1, t, 16);
+ int g = XLERP(g0, g1, t, 16);
+ int b = XLERP(b0, b1, t, 16);
+ return (r << 16) | (g << 8) | b;
+}
+
+static uint32_t lerp_color(uint32_t ca, uint32_t cb, int32_t t)
+{
+ int r0, g0, b0, r1, g1, b1;
+
+ r0 = ca >> 16;
+ g0 = (ca >> 8) & 0xff;
+ b0 = ca & 0xff;
+ r1 = cb >> 16;
+ g1 = (cb >> 8) & 0xff;
+ b1 = cb & 0xff;
+
+ return lerp_rgb(r0, g0, b0, r1, g1, b1, t);
+}
+
+static uint32_t lerp_pcol_rgb(uint32_t pcol, int r, int g, int b, int32_t t)
+{
+ int r0 = pcol >> 16;
+ int g0 = (pcol >> 8) & 0xff;
+ int b0 = pcol & 0xff;
+
+ return lerp_rgb(r0, g0, b0, r, g, b, t);
+}
+