merge: Add test case to HexToRGB algorithm (#1018)

This commit is contained in:
Ankush263
2022-05-17 19:29:42 +05:30
committed by GitHub
parent 4cd6fd4f1b
commit 360c447e72

View File

@ -0,0 +1,16 @@
import { hexStringToRGB } from '../HexToRGB'
test('The RGB form of Hex String E1E1E1 is {r: 225, g: 225, b: 225}', () => {
const res = hexStringToRGB('E1E1E1')
expect(res).toEqual({ r: 225, g: 225, b: 225 })
})
test('The RGB form of Hex String 000000 is {r: 0, g: 0, b: 0}', () => {
const res = hexStringToRGB('000000')
expect(res).toEqual({ r: 0, g: 0, b: 0 })
})
test('The RGB form of Hex String 6CE1CD is {r: 108, g: 225, b: 205}', () => {
const res = hexStringToRGB('6CE1CD')
expect(res).toEqual({ r: 108, g: 225, b: 205 })
})