diff --git a/packages/rn-tester/js/assets/alpha-hotdog.png b/packages/rn-tester/js/assets/alpha-hotdog.png new file mode 100644 index 00000000000..22152504d51 Binary files /dev/null and b/packages/rn-tester/js/assets/alpha-hotdog.png differ diff --git a/packages/rn-tester/js/assets/rainbow.jpeg b/packages/rn-tester/js/assets/rainbow.jpeg new file mode 100644 index 00000000000..170ca5b036c Binary files /dev/null and b/packages/rn-tester/js/assets/rainbow.jpeg differ diff --git a/packages/rn-tester/js/examples/MixBlendMode/MixBlendModeExample.js b/packages/rn-tester/js/examples/MixBlendMode/MixBlendModeExample.js new file mode 100644 index 00000000000..79221155e01 --- /dev/null +++ b/packages/rn-tester/js/examples/MixBlendMode/MixBlendModeExample.js @@ -0,0 +1,131 @@ +/** + * Copyright (c) Meta Platforms, Inc. and affiliates. + * + * This source code is licensed under the MIT license found in the + * LICENSE file in the root directory of this source tree. + * + * @flow strict-local + * @format + * @oncall react_native + */ + +import type {RNTesterModuleExample} from '../../types/RNTesterTypes'; +import type {ViewStyleProp} from 'react-native/Libraries/StyleSheet/StyleSheet'; + +import React from 'react'; +import {useState} from 'react'; +import { + Button, + Image, + ImageBackground, + StyleSheet, + View, + Text, +} from 'react-native'; + +type Props = $ReadOnly<{ + style: ViewStyleProp, + testID?: string, +}>; + +function LayeredView(props: Props) { + return ( + <> + + + + + Hello, World! + + + + + ); +} + +function LayeredImage(props: Props) { + return ( + <> + + + + + + + ); +} + +const styles = StyleSheet.create({ + commonImage: { + width: 200, + height: 100, + marginLeft: 3, + marginTop: 3, + }, + container: { + flexDirection: 'row', + justifyContent: 'space-around', + }, + backdrop: { + opacity: 0.99, // Creating stacking context + height: 110, + }, + commonView: { + backgroundColor: 'cyan', + height: 100, + width: 100, + marginTop: 5, + marginLeft: 5, + }, + nestedView: { + backgroundColor: 'purple', + height: 50, + width: 50, + }, +}); + +const mixBlendModes = [ + 'normal', + 'multiply', + 'screen', + 'overlay', + 'darken', + 'lighten', + 'color-dodge', + 'color-burn', + 'hard-light', + 'soft-light', + 'difference', + 'exclusion', + 'hue', + 'saturation', + 'color', + 'luminosity', +]; + +const examples: Array = mixBlendModes.map(mode => ({ + title: mode, + description: `mix-blend-mode: ${mode}`, + name: mode, + render(): React.Node { + return ( + + + + + ); + }, +})); + +exports.title = 'MixBlendMode'; +exports.category = 'UI'; +exports.description = + 'A set of graphical effects that can be applied to a view.'; +exports.examples = examples; diff --git a/packages/rn-tester/js/utils/RNTesterList.android.js b/packages/rn-tester/js/utils/RNTesterList.android.js index f2ed4d9a090..7eb90f1f9d9 100644 --- a/packages/rn-tester/js/utils/RNTesterList.android.js +++ b/packages/rn-tester/js/utils/RNTesterList.android.js @@ -311,6 +311,11 @@ const APIs: Array = ([ category: 'UI', module: require('../examples/Filter/FilterExample'), }, + { + key: 'MixBlendModeExample', + category: 'UI', + module: require('../examples/MixBlendMode/MixBlendModeExample'), + }, { key: 'VibrationExample', category: 'Basic',