UNPKG

319 BJavaScriptView Raw
1import { processColor } from 'react-native';
2
3export default function processTheme(theme = {}) {
4 return Object.keys(theme).reduce((result, key) => {
5 let value = theme[key];
6 if (key.toLowerCase().endsWith('color')) {
7 value = processColor(value);
8 }
9 return { ...result, [key]: value };
10 }, {});
11}