@@ -686,18 +686,25 @@ namespace Sass {
686
686
error (" cannot specify both RGB and HSL values for `adjust-color`" , pstate);
687
687
}
688
688
if (rgb) {
689
+ double rr = r ? ARGR (" $red" , Number, -255 , 255 )->value () : 0 ;
690
+ double gg = g ? ARGR (" $green" , Number, -255 , 255 )->value () : 0 ;
691
+ double bb = b ? ARGR (" $blue" , Number, -255 , 255 )->value () : 0 ;
692
+ double aa = a ? ARGR (" $alpha" , Number, -1 , 1 )->value () : 0 ;
689
693
return new (ctx.mem ) Color (pstate,
690
- color->r () + (r ? r-> value () : 0 ) ,
691
- color->g () + (g ? g-> value () : 0 ) ,
692
- color->b () + (b ? b-> value () : 0 ) ,
693
- color->a () + (a ? a-> value () : 0 ) );
694
+ color->r () + rr ,
695
+ color->g () + gg ,
696
+ color->b () + bb ,
697
+ color->a () + aa );
694
698
}
695
699
if (hsl) {
696
700
HSL hsl_struct = rgb_to_hsl (color->r (), color->g (), color->b ());
701
+ double ss = s ? ARGR (" $saturation" , Number, -100 , 100 )->value () : 0 ;
702
+ double ll = l ? ARGR (" $lightness" , Number, -100 , 100 )->value () : 0 ;
703
+ double aa = a ? ARGR (" $alpha" , Number, -1 , 1 )->value () : 0 ;
697
704
return hsla_impl (hsl_struct.h + (h ? h->value () : 0 ),
698
- hsl_struct.s + (s ? s-> value () : 0 ) ,
699
- hsl_struct.l + (l ? l-> value () : 0 ) ,
700
- color->a () + (a ? a-> value () : 0 ) ,
705
+ hsl_struct.s + ss ,
706
+ hsl_struct.l + ll ,
707
+ color->a () + aa ,
701
708
ctx,
702
709
pstate);
703
710
}
0 commit comments