Skip to content

Commit 1d6f704

Browse files
committed
[css-color-4] utilities update
1 parent 84c9def commit 1d6f704

2 files changed

Lines changed: 10 additions & 3 deletions

File tree

css-color-4/contrast.html

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,24 @@
77
// then use the contrast() utility function
88
// to compute WCAG contrast.
99

10+
var back=document.querySelector(#fg);
11+
var fore=document.querySelector(#bg);
12+
back.addEventListener("input", updateFirst, false);
13+
fore.addEventListener("input", updateFirst, false);
1014

15+
function watchpickers(event) {
16+
// if either picker changes,
17+
}
1118
</script>
1219
<style>
1320
body {background-color: rgb(46.6346021727084%, 46.6346021727084%, 46.6346021727084%); padding: 20px;}
1421
h2 {color: rgb(243, 235, 166);}
1522
</style>
1623
<h2>Contrast ratio of two colors</h2>
1724
<p>Pick a foreground and background color</p>
18-
<input type="color" id="fg" value="#739">
25+
<input type="color" id="fg" value="#B7C9A3">
1926
<label for="fg">Foreground</label>
20-
<input type="color" id="fg" value="#142">
27+
<input type="color" id="fg" value="#104425">
2128
<label for="fg">Background</label>
2229

2330
<div id="result">

css-color-4/utilities.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// utility functions for color conversions
2-
import "conversions.js";
2+
// needs conversions.js nd math.js (not Math)
33

44
function sRGB_to_luminance(RGB) {
55
// convert an array of gamma-corrected sRGB values

0 commit comments

Comments
 (0)