mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-11 03:10:09 +00:00
cssvalue: Special case resulting color for transparency
Again, preparation for using premultiplied color transitions.
This commit is contained in:
parent
e3d8f03b3a
commit
142abce46a
@ -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);
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user