# Color

The Color field redefines simplicity. Point and click to chose any color in the spectrum.

# Arguments

Name Type Default Description
type string color Value identifying the field type.
transparent bool true Flag to set the display of the transparency checkbox.
validate string The only accepted validation type is color.

Transparency

To set the transparency checkbox by default, use the string transparent in place of a string hex value  in the default argument.

# Build Config

Build a Custom Configuration →
Changes you make to this form will be reflected in the generated code.
Field visibility requirements.

Redux::set_field( 'OPT_NAME', 'SECTION_ID', array(
    'type' => 'color'
) );

# Example Config

Redux::addField( 'OPT_NAME', 'SECTION_ID', array(
    'id'       => 'opt-color',
    'type'     => 'color',
    'title'    => __('Body Background Color', 'redux-framework-demo'), 
    'subtitle' => __('Pick a background color for the theme (default: #fff).', 'redux-framework-demo'),
    'default'  => '#FFFFFF',
    'validate' => 'color',
) );

# Example Usage

This example in based on the example usage provided above. Be sure to change $redux_demo to the value you specified in your opt_name argument.

global $redux_demo;

echo 'Color value: ' . $redux_demo['opt-color'];