-
Notifications
You must be signed in to change notification settings - Fork 0
/
read.html
31 lines (31 loc) · 1.01 KB
/
read.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
<!DOCTYPE html>
<html>
<head>
<title>NFC Color Read</title>
<link rel="stylesheet" type="text/css" href="shared/style/buttons.css">
<link rel="stylesheet" type="text/css" href="style/nfccolor.css">
<script type="text/javascript" src="js/utils.js"></script>
<script type="text/javascript" src="js/color.js"></script>
<script type="text/javascript" src="js/camera.js"></script>
</head>
<body>
<div id="video"></div>
<div id="footer">
<div id="nr"></div>
<div id="colors">
<div id="average"></div>
<div id="closest"></div>
</div>
<a role="button" href="index.html">Back</a>
</div>
<script type="text/javascript">
Camera.start("video", function(imageData){
var average = ColorUtils.averageColor(imageData);
var closest = average.closest();
document.getElementById("average").style.cssText = "background-color: "+average.css;
document.getElementById("closest").style.cssText = "background-color: "+closest.css;
document.getElementById("nr").innerHTML = closest.toByte();
});
</script>
</body>
</html>