Skip to content

Commit 8be38a9

Browse files
committed
Fix circular dependency
1 parent d5175ec commit 8be38a9

File tree

4 files changed

+10
-5
lines changed

4 files changed

+10
-5
lines changed

packages/react-native-reanimated/src/common/utils/index.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,4 @@
11
'use strict';
2-
export * from './colors';
32
export * from './conversions';
43
export * from './guards';
54
export * from './parsers';

packages/react-native-reanimated/src/common/web/style/builders/shadows.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
import type { TextStyle, ViewStyle } from 'react-native';
33

44
import { logger } from '../../../logger';
5-
import { opacifyColor } from '../../../utils';
5+
import { opacifyColor } from '../../utils';
66
import { createRuleBuilder } from '../builderFactories';
77
import { processColor } from '../processors';
88
import type { ValueProcessor } from '../types';

packages/react-native-reanimated/src/common/utils/colors.ts renamed to packages/react-native-reanimated/src/common/web/utils/colors.ts

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,21 @@
11
'use strict';
22
import type { ColorValue } from 'react-native';
33

4-
import { processColor } from '../style';
4+
import { processColorInitially } from '../../../Colors';
55

66
export function opacifyColor(
77
color: ColorValue,
88
opacity: number
99
): string | null {
1010
'worklet';
11-
const colorNumber = processColor(color);
12-
if (colorNumber == null) {
11+
const colorNumber = processColorInitially(color);
12+
13+
if (colorNumber === undefined) {
1314
return null;
1415
}
16+
if (colorNumber === null) {
17+
return 'transparent';
18+
}
1519

1620
const a = (colorNumber >> 24) & 0xff;
1721
const r = (colorNumber >> 16) & 0xff;
Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
'use strict';
2+
export * from './colors';

0 commit comments

Comments
 (0)