-
Notifications
You must be signed in to change notification settings - Fork 10
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #6 from arkin0x/master
problem: problem tracker styles need to be improved
- Loading branch information
Showing
3 changed files
with
110 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const color = [82, 255, 255] // starting color for problem border | ||
const colorIncrement = 70 | ||
|
||
// write a function where the color depends on the depth according to this formula: | ||
// the initial color is rgb(82, 255, 255) | ||
// as the depth increases, g is decremented by 0x0F until it reaches a minimum of 82 | ||
// then r is decremented by 0x0F until it reaches a maximum of 255 | ||
// then b is decremented by 0x0F until it reaches a minimum of 82 | ||
export const getDepthColor = (depth: number): string => { | ||
let [r, g, b] = color; | ||
|
||
// decrement g until it reaches a minimum of 82 | ||
while (depth > 0 && g > 82) { | ||
g -= colorIncrement; | ||
depth--; | ||
} | ||
|
||
// decrement r until it reaches a maximum of 255 | ||
while (depth > 0 && r < 255) { | ||
r += colorIncrement; | ||
depth--; | ||
} | ||
|
||
// decrement b until it reaches a minimum of 82 | ||
while (depth > 0 && b > 82) { | ||
b -= colorIncrement; | ||
depth--; | ||
} | ||
|
||
return `rgb(${r}, ${g}, ${b})`; | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,3 +7,7 @@ | |
width: 100%; | ||
height: 100%; | ||
} | ||
|
||
html { | ||
overflow-x: hidden; | ||
} |