Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 360c447

Browse files
merge: Add test case to HexToRGB algorithm (#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)

AltStyle によって変換されたページ (->オリジナル) /