mirror of
git://git.tartarus.org/simon/puzzles.git
synced 2025-04-20 15:41:30 -07:00
Expose colour_mix() to backends (and others)
Quite a few backends currently generate colours by multiplying the foreground colour by a fraction, effectively mixing it with black. On a black background, this might be reasonably replaced by mixing the background colour with white, but that's rather arithmetically fiddly. Happily, I already have a function for that and just need to expose it.
This commit is contained in:
3
misc.c
3
misc.c
@ -207,8 +207,7 @@ static float colour_distance(const float a[3], const float b[3])
|
||||
(a[2]-b[2]) * (a[2]-b[2]));
|
||||
}
|
||||
|
||||
static void colour_mix(const float src1[3], const float src2[3],
|
||||
float p, float dst[3])
|
||||
void colour_mix(const float src1[3], const float src2[3], float p, float dst[3])
|
||||
{
|
||||
int i;
|
||||
for (i = 0; i < 3; i++)
|
||||
|
Reference in New Issue
Block a user