Skip to content

Commit

Permalink
fixed linting errors
Browse files Browse the repository at this point in the history
  • Loading branch information
jongund committed Jun 7, 2024
1 parent f7c43f4 commit 8214beb
Showing 1 changed file with 9 additions and 6 deletions.
15 changes: 9 additions & 6 deletions content/practices/high-contrast/high-contrast-practice.js
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
/* high-contrast.js */

use strict;

const htmlColorValues = [
{
name: 'INDIAN RED',
Expand Down Expand Up @@ -591,7 +593,8 @@ function computeDistance(hex1, hex2) {
return (
Math.pow(rgb1.r - rgb2.r, 2) +
Math.pow(rgb1.g - rgb2.g, 2) +
Math.pow(rgb1.b - rgb2.b, 2));
Math.pow(rgb1.b - rgb2.b, 2)
);
}

/*
Expand All @@ -606,7 +609,6 @@ function computeDistance(hex1, hex2) {
*/

function getHTMLColorName(systemColorName, colorHex) {

// Check for transparent

if (colorHex[0] !== '#') {
Expand All @@ -623,7 +625,8 @@ function getHTMLColorName(systemColorName, colorHex) {
// See if shade of gray
if (
colorHex.substring(1, 2) === colorHex.substring(3, 4) &&
colorHex.substring(1, 2) === colorHex.substring(5, 6)) {
colorHex.substring(1, 2) === colorHex.substring(5, 6)
) {

switch (colorHex[1]) {
case '0':
Expand Down Expand Up @@ -753,7 +756,7 @@ const systemColorValues = [
desc: 'Text of selected items',
},
{
value:'VisitedText',
value: 'VisitedText',
name: 'Visited text',
desc: 'Text of visited links',
},
Expand Down Expand Up @@ -782,8 +785,8 @@ function rgb2Hex(rgb) {
}

let r = Math.round(parseInt(rgb[0]) * a).toString(16),
g = Math.round(parseInt(rgb[1]) * a).toString(16),
b = Math.round(parseInt(rgb[2]) * a).toString(16);
g = Math.round(parseInt(rgb[1]) * a).toString(16),
b = Math.round(parseInt(rgb[2]) * a).toString(16);

if (r.length == 1) {
r = '0' + r;
Expand Down

0 comments on commit 8214beb

Please sign in to comment.