Skip to content

Commit

Permalink
Fix JS API color.interpolate(color2) without options
Browse files Browse the repository at this point in the history
  • Loading branch information
ntkme committed Sep 28, 2024
1 parent f84e867 commit 5fbd1e1
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions lib/src/js/value/color.dart
Original file line number Diff line number Diff line change
Expand Up @@ -307,11 +307,11 @@ final JSClass colorClass = () {

return changedColor.toSpace(self.space);
},
'interpolate':
(SassColor self, SassColor color2, _InterpolationOptions options) {
'interpolate': (SassColor self, SassColor color2,
[_InterpolationOptions? options]) {
InterpolationMethod interpolationMethod;

if (options.method case var method?) {
if (options?.method case var method?) {
var hue = HueInterpolationMethod.values.byName(method);
interpolationMethod = InterpolationMethod(self.space, hue);
} else if (!self.space.isPolar) {
Expand All @@ -322,7 +322,7 @@ final JSClass colorClass = () {
}

return self.interpolate(color2, interpolationMethod,
weight: options.weight);
weight: options?.weight);
}
});

Expand Down

0 comments on commit 5fbd1e1

Please sign in to comment.