Blockland Forums > Modification Help
code color for script
Port:
--- Quote from: Cubelands on May 14, 2012, 07:29:34 AM ---how I put this colors[0] = "0 146 223 227"; or I am wrong.
--- End quote ---
Since your original color code you wanted to use was RGB, not RGBA, you have to append the alpha-transparency value. If you want the color to be solid, just use 255.
However, when you have a color such as 146 223 227 255, you still need to convert it to the type I specified in my first post in this thread. As mentioned, you do it by dividing each component by 255.
In: 146 223 227 255
146 / 255 ~= 0.572
223 / 255 ~= 0.874
227 / 255 ~= 0.89
255 / 255 = 1
Out: 0.572 0.874 0.89 1
Cubelands:
--- Quote from: Port on May 14, 2012, 07:33:39 AM ---Since your original color code you wanted to use was RGB, not RGBA, you have to append the alpha-transparency value. If you want the color to be solid, just use 255.
However, when you have a color such as 146 223 227 255, you still need to convert it to the type I specified in my first post in this thread. As mentioned, you do it by dividing each component by 255.
In: 146 223 227 255
146 / 255 ~= 0.572
223 / 255 ~= 0.874
227 / 255 ~= 0.89
255 / 255 = 1
Out: 0.572 0.874 0.89 1
--- End quote ---
Oh stuff, I am idiot of math colors. How I can figure it out? use the calculator or what?
Port:
--- Quote from: Cubelands on May 14, 2012, 07:36:42 AM ---Oh stuff, I am idiot of math colors. How I can figure it out?
--- End quote ---
#1: Read my post.
#2: Done.
--- Quote from: Cubelands on May 14, 2012, 07:36:42 AM ---use the calculator or what?
--- End quote ---
You decide.
Cubelands:
Okay I am try using calculator
146 dividie 225 is 0.572549019607843137254901960 78431
225 dividie 146 is 1.746575342465753424657534246 5753
I still not get it.
Port:
--- Quote from: Cubelands on May 14, 2012, 07:49:24 AM ---Okay I am try using calculator
146 dividie 225 is 0.572549019607843137254901960 78431
225 dividie 146 is 1.746575342465753424657534246 5753
I still not get it.
--- End quote ---
Divide each component of the RGBA value by 255 and use a list of the results separated by space for the color[0] value.