mirror of
https://github.com/muerwre/vault-frontend.git
synced 2025-04-25 04:46:40 +07:00
added profile quick info
This commit is contained in:
parent
fa17aac056
commit
1241d2c784
9 changed files with 131 additions and 64 deletions
|
@ -2,7 +2,7 @@ import { useMemo } from 'react';
|
|||
|
||||
import { adjustHue } from 'color2k';
|
||||
|
||||
import { normalizeBrightColor } from '~/utils/color';
|
||||
import { generateGradientFromColor, normalizeBrightColor } from '~/utils/color';
|
||||
import { stringToColour } from '~/utils/dom';
|
||||
|
||||
export const useColorGradientFromString = (
|
||||
|
@ -16,9 +16,5 @@ export const useColorGradientFromString = (
|
|||
return '';
|
||||
}
|
||||
|
||||
const color = normalizeBrightColor(stringToColour(val), saturation, lightness);
|
||||
const second = normalizeBrightColor(adjustHue(color, 45), saturation, lightness);
|
||||
const third = normalizeBrightColor(adjustHue(color, 90), saturation, lightness);
|
||||
|
||||
return `linear-gradient(${angle}deg, ${color}, ${second}, ${third})`;
|
||||
return generateGradientFromColor(val, saturation, lightness, angle);
|
||||
}, [angle, lightness, saturation, val]);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue