mirror of
https://github.com/flame-engine/flame.git
synced 2025-11-02 03:15:43 +08:00
refactor!: Replace Offset with opacityFrom and opacityTo in ColorEffect (#2876)
`ColorEffect`'s API was a bit confusing because it used `Offset` for getting values of opacity start and end from user. This PR changes that to use optional `opacityFrom` and `opacityTo` double parameters. It also adds validate checks on these value to make sure that are between 0 and 1.
This commit is contained in:
@ -69,11 +69,11 @@ class CollidableEmber extends Ember with CollisionCallbacks {
|
||||
add(
|
||||
ColorEffect(
|
||||
index < 2 ? Colors.red : Colors.green,
|
||||
const Offset(0, 0.9),
|
||||
EffectController(
|
||||
duration: 0.2,
|
||||
alternate: true,
|
||||
),
|
||||
opacityTo: 0.9,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user