Calculating color code ........ | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 1

Calculating color code ........

Hii Friends !!!! Please Just Tell Me That How To Calculate The Code Of Color Like -->> For Color Red , Code Is #FF0000 And rgb(255,0,0) Like That ...... Please Tell Me ....... ๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€

7th Apr 2021, 8:08 AM
Tirthen Patel
Tirthen Patel - avatar
7 Answers
+ 5
we can not give you a complete code, but see the hints . when you are going to create a color code as hex value, you can do like this: โ–ช๏ธŽassuming you have integer values like: red= 100, green= 200, blue= 233 โ–ช๏ธŽeach hexcode has to be created individually โ–ช๏ธŽthe way how to do this can be different in various languages. let us take python to do it. โ–ช๏ธŽthe result should be: 100 -> 64, 200 -> c8, 233 -> e9. together with the leading # sign it is #64c8e9 โ–ช๏ธŽto get the 3 individual parts you can use a formatting feature like f-string: โ–ช๏ธŽredH = f"{red:02x}", the string redH now contains "64", do the same with green and blue. โ–ช๏ธŽput all strings together and put a leading # sign in front of it the result is now: #64c8e9 happy coding ad good success!
7th Apr 2021, 10:58 AM
Lothar
Lothar - avatar
+ 4
First show ur attempt
7th Apr 2021, 8:10 AM
KวŸrษจsษฆmวŸ โฅ
KวŸrษจsษฆmวŸ โฅ - avatar
+ 3
Aerith , may be you are looking for a tool so that you can mix colors visually or by numbers. it is working with the HSL color modell that makes it very easy to create a color ( if you understand how this model works) https://www.hexcolortool.com/#ea2ac0,0.77
9th Apr 2021, 2:24 PM
Lothar
Lothar - avatar
+ 1
rgb(255, 0, 0)
7th Apr 2021, 8:09 AM
Alexander Sokolov
Alexander Sokolov - avatar
0
Thanks Friends For Your Best Response But I Know That Calculations . I Want To Know That If I Want To Make Pink Color Or Other Colors Then How Can I Get Its Code Or How Can I Make The Color Code ...... If You Know Then Please Tell Me ...... If Don't Then Thanks For The Answer ๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€๐Ÿ˜€
7th Apr 2021, 1:39 PM
Tirthen Patel
Tirthen Patel - avatar
0
And Special Thanks To -->> Alexander Sokolov -->> โœจkรฅrรฏยงhmรฅโœจ -->> Lothar To Answering Me
7th Apr 2021, 1:44 PM
Tirthen Patel
Tirthen Patel - avatar
7th Apr 2021, 1:47 PM
Tirthen Patel
Tirthen Patel - avatar