Skip to content

Commit

Permalink
More bold colors
Browse files Browse the repository at this point in the history
  • Loading branch information
cmdcolin committed Feb 19, 2025
1 parent 41d422a commit c14af32
Show file tree
Hide file tree
Showing 4 changed files with 303 additions and 297 deletions.
13 changes: 9 additions & 4 deletions plugins/variants/src/shared/drawAlleleCount.ts
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,21 @@ function getColorAlleleCount(alleles: string[], mostFrequentAlt: string) {
if (ref === total) {
return `#ccc`
} else {
let a1 = colord(`hsl(200,50%,${80 - (alt / total) * 50}%)`)
let a1
if (alt) {
a1 = colord(`hsl(200,50%,${80 - (alt / total) * 50}%)`)
}
if (alt2) {
const l = `hsla(0,100%,20%,${alt2 / total})`
// @ts-ignore
a1 = a1.mix(`hsla(0,100%,20%,${alt2 / total})`)
a1 = a1 ? a1.mix(l) : colord(l)
}
if (uncalled) {
const l = `hsl(50,50%,50%,${uncalled / total})`
// @ts-ignore
a1 = a1.mix(`hsla(50,50%,50%,${uncalled / total / 2})`)
a1 = a1 ? a1.mix(l) : colord(l)
}
return a1.toHex()
return a1?.toHex() || 'black'
}
}

Expand Down
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit c14af32

Please sign in to comment.