pretty-easy-hex-to-rgb
Version:
Converts a hex color value to it's coresponding rgb value and returns it in an array like format of red, green, blue color values
27 lines (21 loc) • 749 B
text/typescript
// Dependancie
import * as assert from 'assert';
import * as hexToRgb from '../..';
// For test purposes only
declare function hexToRgb(hexColorValue: string): string;
// Should return an Array of numbers
const shouldReturnString: string = 'Should return an Array of Numbers representing RGB color value ->';
/**
* @description
* Check if the value returns
* an array of number values
* that represent the RGB color
*
* @param {string} info
* @param {string} value
* @param {number[]} equalityCheck
* @returns {*}
*/
export function validHEXValue_returnsString(info: string, equalityCheck: Array<number>, value: string): void {
it(`${shouldReturnString} ${info}`, () => assert.deepEqual(hexToRgb(value), equalityCheck));
}