-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.html
More file actions
43 lines (41 loc) · 1.94 KB
/
index.html
File metadata and controls
43 lines (41 loc) · 1.94 KB
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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=no"/>
<title>CSS Filter Generator</title>
<link rel="stylesheet" type="text/css" href="./main.css">
<script src="https://code.jquery.com/jquery-3.6.4.min.js"></script>
<script src="./main.js"></script>
</head>
<body>
<h1>CSS Filter Generator</h1>
<table>
<tr valign="top">
<td width="50%">
<fieldset>
<p>
<label>Target color</label> <input class="target" type="text" placeholder="target hex" value="#00a4d6"/>
</p>
<button class="execute">Compute Filters</button>
</fieldset>
<p>Real pixel, color applied through CSS <code>background-color</code>:</p>
<div class="pixel realPixel"></div>
<p>Filtered pixel, color applied through CSS <code>filter</code>:</p>
<div class="pixel filterPixel"></div>
<p class="filterDetail"></p>
<p class="lossDetail"></p>
</td>
<td>
<p>The goal was to be able to create custom style sheets and allow for the coloring of icons for <a href="https://sosuke.com/creating-a-dovetail-agent-theme/" target="_blank">Creating a Dovetail Agent Theme</a>.</p>
<p>For this code to work well the starting color needs to be black. If your icon set isn't black you can prepend "brightness(0) saturate(100%)" to your filter property which will first turn the icon set to black.</p>
<p>
For as long as I worked on creating this solution from multiple resources I found some had spent far
longer to create this already completed solution. Only slightly modified to focus on HEX colors. Credit
goes to MultiplyByZer0 for their post <a href="https://stackoverflow.com/a/43960991/604861" target="_blank">https://stackoverflow.com/a/43960991/604861</a>
</p>
</td>
</tr>
</table>
</body>
</html>