-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
153 lines (150 loc) · 6.35 KB
/
index.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
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
<!DOCTYPE html>
<!--
Colour Distance
Copyright (C) 2021 Joshua Saxby
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation, version 3 of the License.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
You should have received a copy of the GNU Affero General Public License v3
along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<html lang="en-GB">
<head>
<title>Colour Distance</title>
<style type="text/css">
body {
background-color: black;
color: lightgrey;
}
input {
background-color: #222222;
color: lightgrey;
}
#colour-board {
border-collapse: collapse;
}
#colour-board td {
border: 1.5rem solid;
/* wide and tall enough for #xxxxxx hex colour code */
width: 5rem;
height: 5rem;
text-align: right;
font-family: monospace;
}
/* TODO: use this for LAB colours which cannot be represented in RGB */
.inexact-colour {
text-decoration-line: underline;
text-decoration-style: solid;
}
.empty-colour-square {
background-image: linear-gradient(45deg, #888888 50%, #cccccc 50%);
}
/*
* set some text with "difference" color effect applied so it
* stands out from the background colour
*/
#colour-board td p {
font-size: 0.7rem;
mix-blend-mode: difference;
color: black;
padding-right: 0.25rem;
margin: 0;
}
/* only show descriptions when hovered over */
#colour-board td p:hover {
text-decoration-color: white;
color: white;
mix-blend-mode: normal;
background-color: #0000007f;
border: 1px solid;
}
/* ...or if explicitly requested by setting class on parent element */
.display-colour-info p {
text-decoration-color: white;
color: white !important;
}
#colour-picker {
float: left;
width: 19em;
text-align: left;
}
#distance-value {
width: 5em;
}
.variable {
font-family: monospace;
font-size: 1.05rem !important;
}
</style>
<script type="module" src="main.js"></script>
</head>
<body>
<h1>Colour Distance</h1>
<p id="version">Version 1.1.0</p>
<hr/>
<p>
A tiny web app to find colours that are a given distance away from a
specified colour, if there are any.
</p>
<p id="colour-picker">
<label for="root-colour">Base Colour </label>
<input type="color" id="root-colour" disabled value="#bbd8f6"/>
<span id="root-colour-hex" class="variable">#??????</span>
<br/>
<label for="distance">Distance </label>
<input type="range" id="distance" disabled min="0" max="206" step="0.01" value="100"/>
<input type="number" id="distance-value" disabled min="0" max="206" step="0.01" class="variable"/>
<br/>
<label for="enable-rgb-only">Only show displayable colours</label>
<input type="checkbox" id="enable-rgb-only" disabled/>
<br/>
<label for="display-colour-info">Show colour IDs</label>
<input type="checkbox" id="display-colour-info" disabled/>
<br/>
<span id="no-javascript" class="variable">This app requires JavaScript</span>
</p>
<p>
<table id="colour-board">
<tr>
<td id="derived-colour-0" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-1" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-2" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-3" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-4" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
</tr>
<tr>
<td id="derived-colour-5" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-6" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-7" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-8" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-9" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
</tr>
<tr>
<td id="derived-colour-10" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-11" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-12" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-13" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-14" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
</tr>
<tr>
<td id="derived-colour-15" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-16" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-17" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-18" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-19" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
</tr>
<tr>
<td id="derived-colour-20" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-21" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-22" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-23" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
<td id="derived-colour-24" class="empty-colour-square"><p><span class="variable"></span><br/><span></span></p></td>
</tr>
</table>
</p>
</body>
</html>