fix bug with ghost comments

pull/173/head
Aevann 2023-07-23 03:29:30 +03:00
parent cc4982f215
commit beff4881aa
1 changed files with 2 additions and 1 deletions

View File

@ -10,13 +10,14 @@ function deltaRgb (rgb1, rgb2) {
}
function toRGBArray(rgbStr) {
console.log(rgbStr)
return rgbStr.match(/\d+/g).map(Number);
}
const background_color = toRGBArray(getComputedStyle(document.documentElement).getPropertyValue('--background'));
for (const line of document.getElementsByClassName('comment-collapse-desktop')) {
if (line.style.borderColor == 'var(--primary)')
continue
const line_color = toRGBArray(line.style.borderColor)
if (deltaRgb(line_color, background_color) < 100) {
const R = Math.abs(background_color[0] - 255)