Commit 142abce4 authored by Benjamin Otte's avatar Benjamin Otte

cssvalue: Special case resulting color for transparency

Again, preparation for using premultiplied color transitions.
parent e3d8f03b
......@@ -68,9 +68,16 @@ gtk_css_value_rgba_transition (GtkCssValue *start,
progress = CLAMP (progress, 0, 1);
result.alpha = transition (start->rgba.alpha, end->rgba.alpha, progress);
result.red = transition (start->rgba.red, end->rgba.red, progress);
result.green = transition (start->rgba.green, end->rgba.green, progress);
result.blue = transition (start->rgba.blue, end->rgba.blue, progress);
if (result.alpha <= 0.0)
{
result.red = result.green = result.blue = 0.0;
}
else
{
result.red = transition (start->rgba.red, end->rgba.red, progress);
result.green = transition (start->rgba.green, end->rgba.green, progress);
result.blue = transition (start->rgba.blue, end->rgba.blue, progress);
}
return _gtk_css_rgba_value_new_from_rgba (&result);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment