DuyTa's picture
Upload folder using huggingface_hub
bc20498 verified
raw
history blame
547 Bytes
/* IMPORT */
import _ from '~/utils';
import Color from '~/color';
import type {CHANNEL, Channels} from '~/types';
/* MAIN */
const adjustChannel = ( color: string | Channels, channel: CHANNEL, amount: number ): string => {
const channels = Color.parse ( color );
const amountCurrent = channels[channel];
const amountNext = _.channel.clamp[channel]( amountCurrent + amount );
if ( amountCurrent !== amountNext ) channels[channel] = amountNext;
return Color.stringify ( channels );
};
/* EXPORT */
export default adjustChannel;