-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathtest.html
33 lines (32 loc) · 910 Bytes
/
test.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
<html>
<head>
<title>color component</title>
<link rel="stylesheet" href="../build/build.css">
<style type="text/css">
div {
width: 100px;
height: 100px;
}
</style>
</head>
<body>
<h1>color component</h1>
<div id="light">light</div>
<div id="nuetral">nuetral</div>
<div id="dark">dark</div>
<script src="../build/build.js" type="text/javascript"></script>
<script type="text/javascript">
var color = require('color'),
light = document.getElementById('light'),
nuetral = document.getElementById('nuetral'),
dark = document.getElementById('dark');
var col = 'red',
darken = color.darken(col, .5);
lighten = color.lighten(col, .5);
console.log(darken, col, lighten);
light.style.backgroundColor = lighten;
dark.style.backgroundColor = darken;
nuetral.style.backgroundColor = col;
</script>
</body>
</html>