mirror of
https://github.com/monkeytypegame/monkeytype.git
synced 2025-11-10 14:10:59 +08:00
customizable opacity
This commit is contained in:
parent
438a1e5ac7
commit
b46fa16785
2 changed files with 8 additions and 4 deletions
|
|
@ -1044,9 +1044,9 @@ export async function applyBurstHeatmap(): Promise<void> {
|
|||
|
||||
const colors = [
|
||||
themeColors.colorfulError,
|
||||
Misc.blendTwoHexColors(themeColors.colorfulError, themeColors.text),
|
||||
Misc.blendTwoHexColors(themeColors.colorfulError, themeColors.text, 0.5),
|
||||
themeColors.text,
|
||||
Misc.blendTwoHexColors(themeColors.main, themeColors.text),
|
||||
Misc.blendTwoHexColors(themeColors.main, themeColors.text, 0.5),
|
||||
themeColors.main,
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -236,7 +236,11 @@ export async function getContributorsList(): Promise<string[]> {
|
|||
}
|
||||
}
|
||||
|
||||
export function blendTwoHexColors(color1: string, color2: string): string {
|
||||
export function blendTwoHexColors(
|
||||
color1: string,
|
||||
color2: string,
|
||||
opacity: number
|
||||
): string {
|
||||
const rgb1 = hexToRgb(color1);
|
||||
const rgb2 = hexToRgb(color2);
|
||||
|
||||
|
|
@ -251,7 +255,7 @@ export function blendTwoHexColors(color1: string, color2: string): string {
|
|||
r: rgb2.r,
|
||||
g: rgb2.g,
|
||||
b: rgb2.b,
|
||||
a: 0.5,
|
||||
a: opacity,
|
||||
};
|
||||
const blended = normalBlend(rgba1, rgba2);
|
||||
return rgbToHex(blended.r, blended.g, blended.b);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue