Skip to content

Commit 360c447

Browse files
authored
merge: Add test case to HexToRGB algorithm (TheAlgorithms#1018)
1 parent 4cd6fd4 commit 360c447

File tree

1 file changed

+16
-0
lines changed

1 file changed

+16
-0
lines changed

Conversions/test/HexToRGB.test.js

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
import { hexStringToRGB } from '../HexToRGB'
2+
3+
test('The RGB form of Hex String E1E1E1 is {r: 225, g: 225, b: 225}', () => {
4+
const res = hexStringToRGB('E1E1E1')
5+
expect(res).toEqual({ r: 225, g: 225, b: 225 })
6+
})
7+
8+
test('The RGB form of Hex String 000000 is {r: 0, g: 0, b: 0}', () => {
9+
const res = hexStringToRGB('000000')
10+
expect(res).toEqual({ r: 0, g: 0, b: 0 })
11+
})
12+
13+
test('The RGB form of Hex String 6CE1CD is {r: 108, g: 225, b: 205}', () => {
14+
const res = hexStringToRGB('6CE1CD')
15+
expect(res).toEqual({ r: 108, g: 225, b: 205 })
16+
})

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy