Created
December 8, 2020 14:32
-
-
Save wowkin2/7001096d35ac0f8d8b091ad9b0d89fbf to your computer and use it in GitHub Desktop.
Highlight Python test coverage with color (for percent row)
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
$('.right').each(function(a, b){ | |
var value = $(this).html(); | |
if (value !== undefined) { | |
var red = 255 - parseInt(value.slice(0, -1)) * 2; | |
var green = 0 + parseInt(value.slice(0, -1)) * 2; | |
var color = 'rgb(' + red + ', ' + green + ', 0)'; | |
$(this).css('background', color); | |
console.log(value, color); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
if jQuery is missing: