-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
45 lines (39 loc) · 1.14 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta http-equiv="X-UA-Compatible" content="ie=edge">
<title>简易取色组件</title>
<style>
body,html{
height: 100%;
}
</style>
<!-- <script src="./dist/colorPickerTSH.js"></script> -->
</head>
<body>
<input type="text" value="#00ff00" id="inputText"/>
<input type="text" value="#00ff00" id="inputText2"/>
</body>
<script>
var colorpicker = new ColorPickerTSH("#inputText",onChange,hideBack);
function onChange(color){
//console.log(color);
//colorpicker.setColor(color.hex,color.alpha)
}
colorpicker.setColor("#ffffff",1);
function hideBack(){
console.log("隐藏事件")
}
var colorpicker2 = new ColorPickerTSH("#inputText2",onChange2,hideBack2);
function onChange2(color){
//console.log(color);
//colorpicker.setColor(color.hex,color.alpha)
}
colorpicker2.setColor("#00ffff",0.8);
function hideBack2(){
console.log("隐藏事件2")
}
</script>
</html>