mirror of
https://github.com/jeffvli/feishin.git
synced 2026-05-10 04:30:25 +02:00
Add rgb to rgba util
This commit is contained in:
@@ -0,0 +1,7 @@
|
||||
export const rgbToRgba = (rgb: string | undefined, alpha: number) => {
|
||||
if (!rgb) {
|
||||
return undefined;
|
||||
}
|
||||
|
||||
return rgb.replace(')', `, ${alpha})`).replace('rgb', 'rgba');
|
||||
};
|
||||
Reference in New Issue
Block a user