šŸ† [MšŸ’™ Challenge] Hex Triplet Colour Shades ā¤šŸ’ššŸ’™šŸ’œšŸ’› | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
+ 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
13 Respostas
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