# 暗黑动态主题色

ThemeValue 配合 useThemeValue 使用获得动态主题色

# Class 组件用法

import React from 'react';
import { TouchableOpacity } from 'react-native';
import { injectTheme, ThemeValue } from '@ezviz/rntheme'
 
class DeviceButton extends Component {
  constructor() {
    super();
  }
 
  render() {
    const backgroundColor = this.props.rntheme.useThemeValue(new ThemeValue('ButtonColorSecondary'));
    return <TouchableOpacity style={{ backgroundColor }}/>;
  }
}
 
export default injectTheme(DeviceButton);

# Function 组件用法

import React from 'react';
import { TouchableOpacity } from 'react-native';
import { ThemeValue, useThemeValue } from '@ezviz/rntheme'
 
export default props => {
  const backgroundColor = useThemeValue(new ThemeValue('ButtonColorSecondary'));
  return <TouchableOpacity style={{ backgroundColor }}/>;
}