initial commit. phase 1 complete

This commit is contained in:
2026-05-05 20:45:19 +02:00
parent d9c68313a0
commit 89e058ffac
20631 changed files with 3224610 additions and 43 deletions
+21
View File
@@ -0,0 +1,21 @@
import { degToRad, M } from './constants.js';
const convertCubehelixToRgb = ({ h, s, l, alpha }) => {
let res = { mode: 'rgb' };
h = (h === undefined ? 0 : h + 120) * degToRad;
let amp = s === undefined ? 0 : s * l * (1 - l);
let cosh = Math.cos(h);
let sinh = Math.sin(h);
res.r = l + amp * (M[0] * cosh + M[1] * sinh);
res.g = l + amp * (M[2] * cosh + M[3] * sinh);
res.b = l + amp * (M[4] * cosh + M[5] * sinh);
if (alpha !== undefined) res.alpha = alpha;
return res;
};
export default convertCubehelixToRgb;