+ 25

๐Ÿ† [M๐Ÿ’™ Challenge] Hex Triplet Colour Shades โค๐Ÿ’š๐Ÿ’™๐Ÿ’œ๐Ÿ’›

Monday Blue ๐Ÿ’™ Challenge Series #5 Let's get colourful this week! If you're familiar with the HTML challenges, there are a few quizzes that require you to identify the shade of colour based on the Hex Triplet (#RRGGBB). ๐Ÿ’ผ TASK Write a program to accept a Hex Triplet (#RRGGBB) and determine whether it represents the colour of the following categories:- "Black" #000000 "White" #FFFFFF "Shade of Grey" Neutral. Equal weightage of all components. "Shade of Red" Red dominant* "Shade of Green" Green dominant* "Shade of Blue" Blue dominant* * pure shades with equal weightage of other components. "Shade of Yellow" Red-Green dominant with relatively higher weightage than Blue. "Shade of Purple" Red-Blue dominant with relatively higher weightage than Green. "Shade of Cyan" Green-Blue dominant with relatively higher weightage than Red. ๐Ÿ”ง TEST CASE #252525 โžก "Shade of Grey" #AA3333 โžก "Shade of Red" #11BB11 โžก "Shade of Green" #CCCCFF โžก "Shade of Blue" #FACE00 โžก "Shade of Yellow" #BB33AA โžก "Shade of Purple" #22DD33 โžก "Shade of Cyan" โค BONUS Creative and clear-cut approach is encouraged. ๐Ÿ‘ SPECIAL MENTION https://code.sololearn.com/W0vQm8LhnxdQ/?ref=app Happy Coding!!! ๐Ÿ˜๐Ÿ’ป

23rd Oct 2017, 2:57 AM
Zephyr Koo
Zephyr Koo - avatar
14 Answers
16th Oct 2017, 4:06 AM
Krishna Teja Yeluripati
Krishna Teja Yeluripati - avatar
+ 14
OMG another fast and furious submission by Sir Krishna again!!! ๐Ÿ”ฅ๐Ÿ˜ฑ
16th Oct 2017, 4:19 AM
Zephyr Koo
Zephyr Koo - avatar
+ 12
My try...I disagree with some of the tests https://code.sololearn.com/cSfG3KJLbmdw/?ref=app
16th Oct 2017, 8:20 PM
David Akhihiero
David Akhihiero - avatar
+ 10
marking thread
16th Oct 2017, 9:38 AM
David Akhihiero
David Akhihiero - avatar
+ 9
Thanks everyone for your participation! I picked the fastest submission by Sir Krishna as there are only a few variation algorithms this time. Besides, I've added a special mention for the awesome visualization with EJS by Calviีฒ in the description as well. Anyway hope you all enjoy and let's move on to the next challenge! โค https://www.sololearn.com/Discuss/808616/?ref=app
23rd Oct 2017, 4:13 AM
Zephyr Koo
Zephyr Koo - avatar
+ 9
Here's my own C# implementation for anyone of you who's interested. ๐Ÿ˜‰ https://code.sololearn.com/cdqQxYAzEfac/?ref=app
23rd Oct 2017, 4:15 AM
Zephyr Koo
Zephyr Koo - avatar
+ 7
@Calviีฒ Yup you're right! I'm having trouble to determine the correct name for it before this. For example Purple can be replaced with Magenta but the former sounds more natural to us. Thanks for your correction! ๐Ÿ˜„
16th Oct 2017, 7:41 AM
Zephyr Koo
Zephyr Koo - avatar
+ 6
@Yerucham Would you mind to elaborate it and the usage of magic number 21? ๐Ÿ˜‰
17th Oct 2017, 2:11 AM
Zephyr Koo
Zephyr Koo - avatar
16th Oct 2017, 9:26 AM
Calviีฒ
Calviีฒ - avatar
+ 4
Another good challenge to try, by @Zephyr ๐Ÿ‘๐Ÿผ๐Ÿค– Btw should R-G dominance color be yellow color, not brown? I think Brown should belong to shade of Red?
16th Oct 2017, 7:02 AM
Calviีฒ
Calviีฒ - avatar
17th Oct 2017, 7:48 PM
Marlene
Marlene - avatar
- 1
HERES A NEW CHALLENGE CHECK IT AND TRY IF YOU WANT https://www.sololearn.com/discuss/793924/?ref=app
17th Oct 2017, 3:11 PM
sayan chandra
sayan chandra - avatar