Skip to content

Commit

Permalink
Add tests for SassColor.interpolate() without options (#2025)
Browse files Browse the repository at this point in the history
[skip dart-sass]
  • Loading branch information
nex3 authored Oct 1, 2024
1 parent 754b799 commit 83bd499
Showing 1 changed file with 20 additions and 0 deletions.
20 changes: 20 additions & 0 deletions js-api-spec/value/color/color-4-conversions.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,4 +228,24 @@ describe('Color 4 SassColors Conversions', () => {
});
});
});

describe('interpolate()', () => {
it('interpolates a rectangular space without options', () =>
expect(
new SassColor({red: 100, green: 200, blue: 50}).interpolate(
new SassColor({red: 255, green: 255, blue: 255})
)
).toLooselyEqualColor(
new SassColor({red: 177.5, green: 227.5, blue: 152.5})
));

it('interpolates a polar space without options', () =>
expect(
new SassColor({hue: 180, saturation: 100, lightness: 50}).interpolate(
new SassColor({red: 100, green: 200, blue: 50})
)
).toLooselyEqualColor(
new SassColor({hue: 140, saturation: 80, lightness: 49.5098039216})
));
});
});

0 comments on commit 83bd499

Please sign in to comment.