Skip to content

Commit

Permalink
Update the JS API
Browse files Browse the repository at this point in the history
  • Loading branch information
nex3 committed Apr 18, 2024
1 parent 751d81d commit 4bd19d5
Showing 1 changed file with 12 additions and 5 deletions.
17 changes: 12 additions & 5 deletions lib/src/js/value/color.dart
Expand Up @@ -87,9 +87,9 @@ final JSClass colorClass = () {
'toSpace': (SassColor self, String space) => _toSpace(self, space),
'isInGamut': (SassColor self, [String? space]) =>
_toSpace(self, space).isInGamut,
'toGamut': (SassColor self, [String? space]) {
'toGamut': (SassColor self, _ToGamutOptions options) {
var originalSpace = self.space;
return _toSpace(self, space).toGamut(GamutMapMethod.localMinde).toSpace(originalSpace);
return _toSpace(self, options.space).toGamut(GamutMapMethod.fromName(options.method)).toSpace(originalSpace);
},
'channel': (SassColor self, String channel, [_ChannelOptions? options]) =>
_toSpace(self, options?.space).channel(channel),
Expand Down Expand Up @@ -460,12 +460,19 @@ class _ConstructionOptions extends _Channels {
@JS()
@anonymous
class _ChannelOptions {
String? space;
external String? get space;
}

@JS()
@anonymous
class _ToGamutOptions {
external String? get space;
external String get method;
}

@JS()
@anonymous
class _InterpolationOptions {
external double? weight;
external String? method;
external double? get weight;
external String? get method;
}

0 comments on commit 4bd19d5

Please sign in to comment.