forked from RGBz/rorschach-blotter
-
Notifications
You must be signed in to change notification settings - Fork 0
/
rorschach.html
50 lines (41 loc) · 1.45 KB
/
rorschach.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
46
47
48
49
50
<html>
<head>
<link rel="icon" type="image/jpg" href="http://en.gravatar.com/userimage/17234499/85c61f1373931799c7849103d1a9aa7a.jpg">
<title>Sample Rorschach Inkblot</title>
<style>
body {text-align:center;font-style:italic;color:#aaa;font-family:sans-serif}
img {border:1px solid #aaa;padding:4px}
canvas {margin:0 auto}
</style>
<script type="text/javascript" src="rorschach.js"></script>
</head>
<body>
<!-- Create an HTML5 canvas to paint on -->
<canvas id="rorschachCanvas" width="800" height="400">
This text is displayed if your browser does not support HTML5 Canvas.
</canvas>
<p>
A nice Rorschach inkblot sample by RGBz
</p>
<p>
<img src="http://en.gravatar.com/userimage/17234499/85c61f1373931799c7849103d1a9aa7a.jpg"/>
</p>
<!-- Run the rorschach script -->
<script type="text/javascript">
// Create a Rorschach inkblot painter
var painter = new RorschachPainter();
// Set the amount of ink range
painter.setInkAmountRange(2500, 25000);
// Set the maximum blob dimensions
painter.setMaximumBlobDimensions(7, 5);
// Set the palette to a few colors
painter.setPalette([
new Color(187, 54, 54),
new Color(127, 187, 95),
new Color(57, 77, 127),
]);
// Paint the inkblot on the canvas element
painter.paint("rorschachCanvas");
</script>
</body>
</html>