Customize: Add hue-only mode to color picker.

The color control in the customizer can use the new mode by supplying the `mode` param with `hue` (as opposed to the new default `full` value). New control replaces the `range` control in Twenty Seventeen for `colorscheme_hue`. The `wpColorPicker` can opt for hue-only mode via supplying `hue` as the `type` option. Iris Color Picker is updated from v1.0.7 to v1.1.0-beta.

Props mattwiebe, celloexpressions.
Fixes #38263.


git-svn-id: https://develop.svn.wordpress.org/trunk@38931 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Weston Ruter
2016-10-25 22:32:55 +00:00
parent 4cfb962850
commit 5de6c7927d
6 changed files with 97 additions and 31 deletions
@@ -44,20 +44,11 @@ function twentyseventeen_customize_register( $wp_customize ) {
'priority' => 5,
) );
$wp_customize->add_control( 'colorscheme_hue', array(
'type' => 'range',
'input_attrs' => array(
'min' => 0,
'max' => 359,
'step' => 1,
),
$wp_customize->add_control( new WP_Customize_Color_Control( $wp_customize, 'colorscheme_hue', array(
'mode' => 'hue',
'section' => 'colors',
'priority' => 6,
'description' => 'Temporary hue slider will be replaced with a visual hue picker that is only shown when a custom scheme is selected', // temporary, intentionally untranslated.
// @todo change this to a visual hue picker control, ideally extending the color control and leveraging iris by adding a `hue` mode in core.
// See https://core.trac.wordpress.org/ticket/38263
// @todo only show this control when the colorscheme is custom.
) );
) ) );
/**
* Add the Theme Options section.