react-native-macos
Version:
[Microsoft Fork] A framework for building native apps using React
34 lines (30 loc) • 885 B
JavaScript
/**
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*
* @format
* @flow
*/
// [TODO(macOS ISS#2323203)
;
import type {NativeOrDynamicColorType} from 'NativeOrDynamicColorType';
function processColorObject(
color: NativeOrDynamicColorType,
): ?NativeOrDynamicColorType {
if ('dynamic' in color && color.dynamic !== undefined) {
const processColor = require('processColor');
const dynamic = color.dynamic;
const dynamicColor: NativeOrDynamicColorType = {
dynamic: {
light: processColor(dynamic.light),
dark: processColor(dynamic.dark),
},
};
return dynamicColor;
}
return color;
}
module.exports = processColorObject;
// ]TODO(macOS ISS#2323203)