Initial Commit

This commit is contained in:
2026-01-15 21:52:12 +01:00
committed by erik
parent 3ed42cdeb6
commit 5a70f775f1
6702 changed files with 1389544 additions and 0 deletions

22
node_modules/color-space/lrgb.js generated vendored Normal file
View File

@@ -0,0 +1,22 @@
/**
* Linear RGB space.
*
* @module color-space/lrgb
*/
import rgb from './rgb.js';
const lrgb = {
name: 'lrgb',
min: [0, 0, 0],
max: [1, 1, 1],
channel: ['red', 'green', 'blue']
};
lrgb.rgb = lrgb => lrgb.map(channel => ((channel /= 255) <= 0.0031308
? 12.92 * channel
: 1.055 * channel ** (1 / 2.4) - 0.055) * 255)
rgb.lrgb = rgb => rgb.map(c => (c / 255) <= 0.04045 ? (c / 255) / 12.92 : ((c / 255 + 0.055) / 1.055) ** 2.4);
// TODO: add xyz transform, see https://github.com/color-js/color.js/blob/main/src/spaces/srgb-linear.js
export default lrgb;