UNPKG

456 BPlain TextView Raw
1import { BlurTint } from './BlurView.types';
2
3export default function getBackgroundColor(intensity: number, tint: BlurTint): string {
4 const opacity = intensity / 100;
5 switch (tint) {
6 case 'dark':
7 return `rgba(28,28,28,${opacity * 0.73})`;
8 case 'light':
9 return `rgba(247,247,247,${opacity * 0.8})`;
10 case 'default':
11 return `rgba(255,255,255,${opacity * 0.3})`;
12 }
13 throw new Error(`Unsupported tint provided: ${tint}`);
14}