Skip to content

Commit

Permalink
add more level colors
Browse files Browse the repository at this point in the history
  • Loading branch information
xi committed Jul 18, 2022
1 parent acdb62f commit f0bae95
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 2 deletions.
2 changes: 1 addition & 1 deletion apca.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const levels = [45, 60, 75];
export const levels = [15, 30, 45, 60, 75, 90];

const tests = [
[[136, 136, 136], [255, 255, 255], 63.056469930209424],
Expand Down
3 changes: 3 additions & 0 deletions tool/tool.js
Original file line number Diff line number Diff line change
Expand Up @@ -73,9 +73,12 @@ var score = function(range, levels) {
var makeGradient = function(scores) {
const colors = [
'hsl(0, 100%, 40%)',
'hsl(13, 100%, 45%)',
'hsl(26, 100%, 45%)',
'hsl(40, 100%, 45%)',
'hsl(80, 60%, 45%)',
'hsl(95, 60%, 41%)',
'hsl(-70, 80%, 40%)',
];

var stops = [];
Expand Down
2 changes: 1 addition & 1 deletion wcag2.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export const levels = [3, 4.5, 7];
export const levels = [3, 3, 3, 4.5, 7, 100];

var sRGBtoY = function(srgb) {
var pre = c => c < 0.04045 ? c / 12.92 : Math.pow((c + 0.055) / 1.055, 2.4);
Expand Down

0 comments on commit f0bae95

Please sign in to comment.