更新时间:2021-03-23 01:40:13
文件引入:
<link rel="stylesheet" href="./colorpicker.css"> <script src="./colorpicker.js"></script>
html:
<div id="color-picker"></div>
js调用:
var a = Colorpicker.create({ el: "color-picker", color: "rgba(38, 166, 153, 0.8)", change: function(elem, rgba) { elem.style.backgroundColor = rgba; } })