1: <?php
2:
3: 4: 5: 6:
7: class Papi_Property_Color extends Papi_Property {
8:
9: 10: 11: 12: 13:
14: public function get_default_settings() {
15: return [
16: 'palettes' => [],
17: 'show_input' => true
18: ];
19: }
20:
21: 22: 23:
24: public function html() {
25: $settings = $this->get_settings();
26: $value = $this->get_value();
27:
28: papi_render_html_tag( 'div', [
29: 'class' => 'papi-property-color-picker',
30:
31: papi_html_tag( 'input', [
32: 'data-palettes' => $settings->palettes,
33: 'id' => $this->html_id(),
34: 'name' => $this->html_name(),
35: 'type' => $settings->show_input === true ? 'text' : 'hidden',
36: 'value' => $value,
37: ] )
38:
39: ] );
40: }
41: }
42: