add hw2
This commit is contained in:
13
node_modules/khroma/dist/methods/change.js
generated
vendored
Normal file
13
node_modules/khroma/dist/methods/change.js
generated
vendored
Normal file
@@ -0,0 +1,13 @@
|
||||
/* 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;
|
||||
Reference in New Issue
Block a user