@@ -12,13 +12,14 @@ import '../utils.dart';
12
12
final JSClass colorClass = () {
13
13
var jsClass = createJSClass ('sass.SassColor' , (Object self, _Channels color) {
14
14
if (color.red != null ) {
15
- return SassColor .rgb (color.red! , color.green! , color.blue! , color.alpha);
15
+ return SassColor .rgb (color.red! , color.green! , color.blue! ,
16
+ _handleUndefinedAlpha (color.alpha));
16
17
} else if (color.saturation != null ) {
17
18
return SassColor .hsl (color.hue! , color.saturation! , color.lightness! ,
18
- _handleNullAlpha (color.alpha));
19
+ _handleUndefinedAlpha (color.alpha));
19
20
} else {
20
21
return SassColor .hwb (color.hue! , color.whiteness! , color.blackness! ,
21
- _handleNullAlpha (color.alpha));
22
+ _handleUndefinedAlpha (color.alpha));
22
23
}
23
24
});
24
25
@@ -69,9 +70,9 @@ final JSClass colorClass = () {
69
70
70
71
/// Converts an undefined [alpha] to 1.
71
72
///
72
- /// This ensures that an explicitly null alpha will produce a deprecation
73
- /// warning when passed to the Dart API .
74
- num ? _handleNullAlpha (num ? alpha) => isUndefined (alpha) ? 1 : alpha;
73
+ /// This ensures that an explicitly null alpha will be treated as a missing
74
+ /// component .
75
+ num ? _handleUndefinedAlpha (num ? alpha) => isUndefined (alpha) ? 1 : alpha;
75
76
76
77
@JS ()
77
78
@anonymous
0 commit comments