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:
Created | Mar 11, 2013 |
Published | Mar 13, 2013 |
Warriors Trained | 235206 |
Total Skips | 29768 |
Total Code Submissions | 483851 |
Total Times Completed | 140653 |
JavaScript Completions | 49291 |
CoffeeScript Completions | 182 |
Ruby Completions | 3922 |
Python Completions | 51562 |
C# Completions | 9955 |
C++ Completions | 6963 |
R Completions | 201 |
Dart Completions | 815 |
F# Completions | 186 |
C Completions | 3173 |
Swift Completions | 972 |
NASM Completions | 56 |
Lua Completions | 296 |
Julia Completions | 118 |
Kotlin Completions | 1196 |
Scala Completions | 537 |
Rust Completions | 2439 |
PHP Completions | 2759 |
Elixir Completions | 305 |
Racket Completions | 44 |
Clojure Completions | 179 |
Factor Completions | 23 |
Go Completions | 1525 |
Java Completions | 5276 |
TypeScript Completions | 1900 |
COBOL Completions | 10 |
Groovy Completions | 14 |
Total Stars | 2579 |
% of votes with a positive feedback rating | 89% of 9654 |
Total "Very Satisfied" Votes | 7684 |
Total "Somewhat Satisfied" Votes | 1739 |
Total "Not Satisfied" Votes | 231 |