add hw2
This commit is contained in:
16
node_modules/khroma/dist/methods/adjust.js
generated
vendored
Normal file
16
node_modules/khroma/dist/methods/adjust.js
generated
vendored
Normal file
@@ -0,0 +1,16 @@
|
||||
/* IMPORT */
|
||||
import Color from '../color/index.js';
|
||||
import change from './change.js';
|
||||
/* MAIN */
|
||||
const adjust = (color, channels) => {
|
||||
const ch = Color.parse(color);
|
||||
const changes = {};
|
||||
for (const c in channels) {
|
||||
if (!channels[c])
|
||||
continue;
|
||||
changes[c] = ch[c] + channels[c];
|
||||
}
|
||||
return change(color, changes);
|
||||
};
|
||||
/* EXPORT */
|
||||
export default adjust;
|
||||
Reference in New Issue
Block a user