Skip to content

Commit d5538d1

Browse files
committed
Little improvements
1 parent d6ddfc4 commit d5538d1

File tree

3 files changed

+3
-10
lines changed

3 files changed

+3
-10
lines changed

packages/react-native-reanimated/__tests__/InterpolateColor.test.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -133,7 +133,7 @@ describe('colors interpolation', () => {
133133
});
134134

135135
describe('transparent color interpolation', () => {
136-
const basicCases = [
136+
const cases = [
137137
{
138138
name: 'transparent to color at midpoint',
139139
value: 0.5,
@@ -178,7 +178,7 @@ describe('colors interpolation', () => {
178178
];
179179

180180
colorSpaces.forEach(({ colorSpace, options, eps }) => {
181-
test.each(basicCases)(
181+
test.each(cases)(
182182
`$name using ${colorSpace}${options ? ` with options ${JSON.stringify(options)}` : ''}`,
183183
({ value, inputRange, outputRange, expected }) => {
184184
const result = interpolateColor(

packages/react-native-reanimated/src/css/native/style/processors/colors.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,5 @@ export const processColor: ValueProcessor<
2828
throw new ReanimatedError(ERROR_MESSAGES.invalidColor(value));
2929
}
3030

31-
console.log('>>> normalizedColor', normalizedColor);
32-
3331
return normalizedColor;
3432
};

packages/react-native-reanimated/src/interpolateColor.ts

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -153,12 +153,7 @@ const interpolateColorsHSV = (
153153
colors.v,
154154
Extrapolation.CLAMP
155155
);
156-
const a = interpolateColorChannel(
157-
value,
158-
inputRange,
159-
colors.a,
160-
Extrapolation.CLAMP
161-
);
156+
const a = interpolate(value, inputRange, colors.a, Extrapolation.CLAMP);
162157
return hsvToColor(h, s, v, a);
163158
};
164159

0 commit comments

Comments
 (0)