Files
infocom-systems-design/node_modules/khroma/dist/methods/change.js
2025-10-03 22:27:28 +03:00

14 lines
329 B
JavaScript

/* IMPORT */
import _ from '../utils/index.js';
import Color from '../color/index.js';
/* MAIN */
const change = (color, channels) => {
const ch = Color.parse(color);
for (const c in channels) {
ch[c] = _.channel.clamp[c](channels[c]);
}
return Color.stringify(ch);
};
/* EXPORT */
export default change;