-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathtest.php
More file actions
53 lines (45 loc) · 917 Bytes
/
test.php
File metadata and controls
53 lines (45 loc) · 917 Bytes
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
52
53
<!doctype html>
<html>
<head>
<meta charset="utf-8" />
<title>Color Palette Test</title>
<style>
body {
margin: 0px;padding:0px;
}
.box {
width: 25%;
height: 200px;
float: left;
margin:0px;
padding:0px;
text-align: center;
}
.image {
margin:10px;
text-align: center;
}
</style>
</head>
<body>
<div class='image'>
<img width="150" height="150" src='test.jpg' alt='color palette test image' />
</div>
<?php
require "PKColor.php";
$pkc = new PKColor();
$palette = $pkc->setGranularity(20)
->setPicture("test.jpg")
->setColorsCount(10)
->getIt();
print_r($palette);
?>
<?php
foreach($palette as $color):
?>
<div class='box' style="background:#<?=$color?> ">#<?=$color?></div>
<?php
endforeach;
?>
</body>
</html>