monex
Version:
Execute one or multiple scripts, interactively or in daemon mode, and restart them whenever they crash or a watched file changes.
26 lines (13 loc) • 355 B
text/typescript
/* IMPORT */
import type {Color as IColor} from '~/types';
/* MAIN */
const Color = {
/* API */
inferColor: ( nr: number ): IColor => {
const colors: IColor[] = ['blue', 'magenta', 'yellow', 'cyan', 'red', 'green'];
const index = Math.abs ( nr ) % colors.length;
return colors[index];
}
};
/* EXPORT */
export default Color;