5 kyu

RGB To Hex Conversion

51,562 of 140,653jhoffner

Description:

The rgb function is incomplete. Complete it so that passing in RGB decimal values will result in a hexadecimal representation being returned. Valid decimal values for RGB are 0 - 255. Any values that fall out of that range must be rounded to the closest valid value.

Note: Your answer should always be 6 characters long, the shorthand with 3 will not work here.

Examples (input --> output):

255, 255, 255 --> "FFFFFF"
255, 255, 300 --> "FFFFFF"
0, 0, 0       --> "000000"
148, 0, 211   --> "9400D3"
Algorithms

Similar Kata:

Stats:

CreatedMar 11, 2013
PublishedMar 13, 2013
Warriors Trained235206
Total Skips29768
Total Code Submissions483851
Total Times Completed140653
JavaScript Completions49291
CoffeeScript Completions182
Ruby Completions3922
Python Completions51562
C# Completions9955
C++ Completions6963
R Completions201
Dart Completions815
F# Completions186
C Completions3173
Swift Completions972
NASM Completions56
Lua Completions296
Julia Completions118
Kotlin Completions1196
Scala Completions537
Rust Completions2439
PHP Completions2759
Elixir Completions305
Racket Completions44
Clojure Completions179
Factor Completions23
Go Completions1525
Java Completions5276
TypeScript Completions1900
COBOL Completions10
Groovy Completions14
Total Stars2579
% of votes with a positive feedback rating89% of 9654
Total "Very Satisfied" Votes7684
Total "Somewhat Satisfied" Votes1739
Total "Not Satisfied" Votes231
Ad
Contributors
  • jhoffner Avatar
  • GiacomoSorbi Avatar
  • FlixTron Avatar
  • imjasonmiller Avatar
  • kazk Avatar
  • kleidemos Avatar
  • docgunthrop Avatar
  • bshore Avatar
  • wneumann Avatar
  • AlexPuts Avatar
  • Voile Avatar
  • Madjosz Avatar
  • hdo Avatar
  • Souzooka Avatar
  • rowcased Avatar
  • mentalplex Avatar
  • kdmatrosov Avatar
  • FArekkusu Avatar
  • timsneath Avatar
  • lbvf50mobile Avatar
  • monadius Avatar
  • user9277937 Avatar
  • uglywarthog Avatar
  • user9644768 Avatar
  • hobovsky Avatar
  • cliffstamp Avatar
  • uniapi Avatar
  • xavierguihot Avatar
  • stellartux Avatar
  • trashy_incel Avatar
  • kirull Avatar
  • Jardyn Avatar
  • SunMaster Avatar
  • user8436785 Avatar
  • user7527943 Avatar
  • jim80net Avatar
  • s_x_n Avatar
  • akar-0 Avatar
  • Kacarott Avatar
  • Wei-Ting Yang Avatar
  • dfhwze Avatar
  • Just4FunCoder Avatar
  • marcluque Avatar
  • FranzMartyn Avatar
  • jdold07 Avatar
  • jpssj Avatar
  • KayleighWasTaken Avatar
Ad