MCPcopy Create free account
hub / github.com/JACoders/OpenJK / LerpColor

Function LerpColor

code/ui/ui_shared.cpp:8379–8396  ·  view source on GitHub ↗

================= LerpColor ================= */

Source from the content-addressed store, hash-verified

8377=================
8378*/
8379void LerpColor(vec4_t a, vec4_t b, vec4_t c, float t)
8380{
8381 int i;
8382
8383 // lerp and clamp each component
8384 for (i=0; i<4; i++)
8385 {
8386 c[i] = a[i] + t*(b[i]-a[i]);
8387 if (c[i] < 0)
8388 {
8389 c[i] = 0;
8390 }
8391 else if (c[i] > 1.0)
8392 {
8393 c[i] = 1.0;
8394 }
8395 }
8396}
8397
8398/*
8399=================

Callers 5

Item_TextColorFunction · 0.70
Item_TextField_PaintFunction · 0.70
Item_Bind_PaintFunction · 0.70
Item_OwnerDraw_PaintFunction · 0.70
Item_Slider_PaintFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected