|
@@ -4985,6 +4985,8 @@ Vector3 ColorToHSV(Color color)
|
|
|
return hsv;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+
|
|
|
// Get a Color from HSV values
|
|
|
// Implementation reference: https://en.wikipedia.org/wiki/HSL_and_HSV#Alternative_HSV_conversion
|
|
|
// NOTE: Color->HSV->Color conversion will not yield exactly the same color due to rounding errors
|
|
@@ -5422,6 +5424,24 @@ int GetPixelDataSize(int width, int height, int format)
|
|
|
return dataSize;
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+// Mix 2 Colors togehter.
|
|
|
+// d = dominance. 0.5 for equal
|
|
|
+Color ColorLerp(Color color1, Color color2, float d)
|
|
|
+{
|
|
|
+ Color newColor = { 0, 0, 0, 0 };
|
|
|
+ if (d < 0) {d=0.0f;}
|
|
|
+ else if(d>1) {d=1.0f;}
|
|
|
+
|
|
|
+ newColor.r = (unsigned char)((1.0f-d) * color1.r + d * color2.r);
|
|
|
+ newColor.g = (unsigned char)((1.0f-d) * color1.g + d * color2.g);
|
|
|
+ newColor.b = (unsigned char)((1.0f-d) * color1.b + d * color2.b);
|
|
|
+ newColor.a = (unsigned char)((1.0f-d) * color1.a + d * color2.a);
|
|
|
+
|
|
|
+ return newColor;
|
|
|
+}
|
|
|
+
|
|
|
+
|
|
|
//----------------------------------------------------------------------------------
|
|
|
// Module specific Functions Definition
|
|
|
//----------------------------------------------------------------------------------
|