kak/colorpicker
最新稳定版本:v1.0.0
Composer 安装命令:
composer require kak/colorpicker
包简介
color picker widgets for Yii2
README 文档
README
The preferred way to install this extension is through composer.
Either run
php composer.phar require --prefer-dist kak/colorpicker "*"
This package contains 2 widgets InputColor, InputGradient
Input Color
Preview
Usage
Once the extension is installed, simply use it in your code by :
<?= $form->field($model, 'color')->widget(InputColor::class, [ 'clientOptions' => [], // js options lib pickr 'theme' => InputColor::THEME_MONOLITH, // default theme 'addonPreview' => true, // displays a preview of the color next to the {input} // 'addonPreview' => false, // displays the {input} preview in the background and inverts the text color ]); ?>
clientOptions see js lib https://github.com/Simonwep/pickr#options
Input Gradient
Preview
Usage
Once the extension is installed, simply use it in your code by :
<?= $form->field($model, 'color_gradient')->widget(InputGradient::class, [ 'clientOptions' => [], // js options lib pickr 'theme' => InputColor::THEME_MONOLITH, // default theme 'createLabel' => '', // btn create point label 'createOptions' => [], // btn create point options ]); ?>
clientOptions see js lib https://github.com/Simonwep/pickr#options
JS Events
gradient:change(colors)- format argument event
[{ color: 'hex|rbg', stop: '13' }]
统计信息
- 总下载量: 2.64k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 0
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2020-02-27