-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathdemo.tsx
51 lines (44 loc) · 1.08 KB
/
demo.tsx
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
46
47
48
49
50
51
import { AnyColor } from "colord";
import React from "react";
import ReactDOM from "react-dom";
import { SweetColorPicker } from "./src/components/SweetColorPicker";
const onColorPicker1Change = (color: AnyColor) => {};
const ColorPicker1 = (
<SweetColorPicker
triggerType="button"
colorMode="rgba"
color="rgb(222, 223, 250)"
onChange={onColorPicker1Change}
/>
);
const onColorPicker2Change = (color: AnyColor) => {};
const ColorPicker2 = (
<SweetColorPicker
triggerType="button"
colorMode="hsl"
color="#00ff00"
onChange={onColorPicker2Change}
/>
);
const onColorPicker3Change = (color: AnyColor) => {};
const ColorPicker3 = (
<SweetColorPicker
triggerType="input"
colorMode="hex"
color="#f00"
adaptiveAlpha={true}
onChange={onColorPicker3Change}
/>
);
ReactDOM.render(
ColorPicker1,
document.querySelector(".control-1 .control-component")
);
ReactDOM.render(
ColorPicker2,
document.querySelector(".control-2 .control-component")
);
ReactDOM.render(
ColorPicker3,
document.querySelector(".control-3 .control-component")
);