Packages

Advanced configurable navigation component for Phoenix LiveView with native DaisyUI integration, Tailwind CSS support, permissions filtering, dropdowns, mega menus, and modern responsive design. Optimized for Phoenix 1.8+ and LiveView 1.1+.

Current section

Files

Jump to
navbuddy assets node_modules culori src lrgb convertLrgbToRgb.js
Raw

assets/node_modules/culori/src/lrgb/convertLrgbToRgb.js

const fn = c => {
const abs = Math.abs(c);
if (abs > 0.0031308) {
return (Math.sign(c) || 1) * (1.055 * Math.pow(abs, 1 / 2.4) - 0.055);
}
return c * 12.92;
};
const convertLrgbToRgb = ({ r, g, b, alpha }, mode = 'rgb') => {
let res = {
mode,
r: fn(r),
g: fn(g),
b: fn(b)
};
if (alpha !== undefined) res.alpha = alpha;
return res;
};
export default convertLrgbToRgb;