UNPKG

khroma

Version:

A collection of functions for manipulating CSS colors, inspired by SASS.

19 lines (10 loc) 308 B
/* IMPORT */ import _ from '~/utils'; import Color from '~/color'; import type {CHANNEL, Channels} from '~/types'; /* MAIN */ const channel = ( color: string | Channels, channel: CHANNEL ): number => { return _.lang.round ( Color.parse ( color )[channel] ); }; /* EXPORT */ export default channel;