+ 2
when you only know the values of R, G, and B (in color), how do you put it in your code?
4 Answers
+ 7
Use this format
style=color:#00ff00
+ 2
Which language?
I can answer for CSS:
https://www.w3schools.com/colors/colors_rgb.asp
+ 2
I wrote a python script that will convert it to hexadecimal. Enter your 3 values and run the script.
https://code.sololearn.com/czu7qnKGDXi2/?ref=app
+ 1
If you know the values of R, G and B in decimal, and yu want to put it in CSS code without knowing how to convert to hexadecimal form (#xxxxxx with x from 0 to 9 or a to f), you could use the rgb form (rgb(r,g,b) with r,g,b from 0 to 255) or even rgba form(rgb and alpha --opacity -- channel rgba(r,g,b,a) with r,g,b from 0 to 255 and a as floating point number from 0 to 1 -- e.g. 0.5 for half-transparency)