blob: 825cf084466e80a4971fe3d72d639d89e5d2f6f6 (
plain)
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
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
|
<!doctype html>
<html lang="en">
<head>
<title>phpColors Demo</title>
<?php
require_once __DIR__ . '/../src/Mexitek/PHPColors/Color.php';
use Mexitek\PHPColors\Color;
// Use different colors to test
$myBlue = new Color("#336699");
$myBlack = new Color("#333");
$myPurple = new Color("#913399");
$myVintage = new Color("#bada55");
// ************** No Need to Change Below **********************
?>
<style>
.block {
height: 100px;
width: 200px;
font-size: 20px;
text-align: center;
padding-top: 100px;
display: block;
margin: 0;
float: left;
}
.wide-block {
width: 360px;
padding-top: 70px;
padding-left: 20px;
padding-right: 20px;
margin-top: 10px;
}
.clear {
clear: both;
}
.testDiv {
<?= $myBlue->getCssGradient()?>
color: <?=($myBlue->isDark() ? "#EEE":"#333")?>;
}
.testDiv.plain {
background: #<?= $myBlue->getHex()?>;
color: <?=($myBlue->isDark() ? "#EEE":"#333")?>;
}
.testDiv2 {
<?= $myBlack->getCssGradient()?>
color: <?=($myBlack->isDark() ? "#EEE":"#333")?>;
}
.testDiv2.plain {
background: #<?= $myBlack->getHex();?>;
color: <?=($myBlack->isDark() ? "#EEE":"#333")?>;
}
.testDiv3 {
<?= $myPurple->getCssGradient()?>
color: <?=($myPurple->isDark() ? "#EEE":"#333")?>;
}
.testDiv3.plain {
background: #<?= $myPurple->getHex()?>;
color: <?=($myPurple->isDark() ? "#EEE":"#333")?>;
}
.testDiv4 {
<?= $myVintage->getCssGradient(30, true)?>
color: <?=($myVintage->isDark() ? "#EEE":"#333")?>;
}
</style>
</head>
<body>
<div class="clear"></div>
<div class="block testDiv">phpColor Gradient #<?= $myBlue->getHex() ?></div>
<div class="block testDiv plain">Plain #<?= $myBlue->getHex() ?></div>
<div class="clear"></div>
<div class="block testDiv2">phpColor Gradient #<?= $myBlack->getHex() ?></div>
<div class="block testDiv2 plain">Plain #<?= $myBlack->getHex() ?></div>
<div class="clear"></div>
<div class="block testDiv3">phpColor Gradient #<?= $myPurple->getHex() ?></div>
<div class="block testDiv3 plain">Plain #<?= $myPurple->getHex() ?></div>
<div class="clear"></div>
<div class="block wide-block testDiv4">
phpColor Gradient with vintage browsers support #<?= $myVintage->getHex() ?>
</div>
</body>
</html>
|