orange35 / magento2-color-picker-element
Color Picker Element
Installs: 283
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 1
Open Issues: 0
Language:JavaScript
Type:magento2-module
Requires
- php: ~5.5.0|~5.6.0|~7.0.6|~7.1.0|~7.2.0|~7.3.0|~7.4.0
This package is auto-updated.
Last update: 2025-04-07 18:56:56 UTC
README
Color Picker Element is a Magento 2 module with the following features:
orange35ColorPickerElement
- uiClass for an input based on jQuery colorpicker. Shows chosen color as input background and shows color hex code as input text in contrast with background.Orange35\ColorPickerElement\Data\Form\Element\Color
- element for system configuration
Installation
composer require orange35/magento2-color-picker-element
Usage
Add element in system configuration
<field id="color" translate="label" type="Orange35\ColorPickerElement\Data\Form\Element\Color" sortOrder="10" showInDefault="1" showInWebsite="1" showInStore="1" canRestore="1">
<label>Color</label>
</field>
Attach to input
Example 1:
<script type="text/x-magento-init">
{
"color-element-id": {
"orange35ColorPickerElement": {}
}
}
</script>
Example 2:
<input type="text" name="color" data-mage-init='{"orange35ColorPickerElement":{}}' />