Convert RGB to HEX

When given a RGB as their own inputs, output the relating hex code.

IN

255
255
0

OUT

FFFF00

IN

255
0
0

OUT

FF0000

IN

255
255
255

OUT

FFFFFF

IN

204
102
153

OUT

CC6699

IN

51
51
255

OUT

3333FF

IN

3
56
72

OUT

033848

IN

144
228
254

OUT

90E4FE

IN

255
198
121

OUT

FFC679

IN

255
250
66

OUT

FFFA42

IN

228
59
126

OUT

E43B7E

IN

103
156
52

OUT

679C34

IN

55
28
135

OUT

371C87

IN

253
107
0

OUT

FD6B00

IN

0
255
255

OUT

00FFFF
Login to submit solution


19 symbols perl failed test 1 Wrong answer
FF00FF00000
instead of
FFFF00
Mon Feb 19 15:51:02 2018 k-mx
#!/usr/bin/perl -a
printf('%X'x3,@F)
19 symbols perl failed test 1 Wrong answer
FF0FF000
instead of
FFFF00
Mon Feb 19 15:51:49 2018 k-mx
#!/usr/bin/perl -a
printf('%X'x2,@F)
15 symbols perl failed test 1 Wrong answer
00
instead of
FFFF00
Mon Feb 19 15:55:44 2018 k-mx
printf'%02X',$_
8 symbols pyth failed test 1 Code error

Traceback (most recent call last): File "/usr/bin/pyth.py", line 713, in <module> exec(py_code_line, environment) File "<string>", line 2, in <module> TypeError: Pmap() missing 1 required positional argument: 'b'

Mon Mar 26 23:17:21 2018 GolfingSuccess
sm.H[QEE
8 symbols pyth failed test 1 Wrong answer
ffff0
instead of
FFFF00
Mon Mar 26 23:17:55 2018 GolfingSuccess
s.HM[QEE
16 symbols pyth failed test 1 Wrong answer
0A0A0A
instead of
FFFF00
Mon Mar 26 23:19:49 2018 GolfingSuccess
sm.[\02r.Hb1[QEE
90 symbols haskell failed test 1 Wrong answer
FFFF0
instead of
FFFF00
Wed Sep 19 10:47:44 2018 YoshikuniJujo
import Data.Char
import Numeric
main=interact$(>>= (map toUpper.(`showHex`"").read)).lines

View all solutions