Author Topic: code color for script  (Read 2977 times)

I am try find out where I get color code for script, like this
Code: [Select]
colors[0] = "0 1 1 1";
I am sure it not Hex or RGB code.

It's a floating-point RGBA value, where 0 >= element <= 1.

To convert a regular 8-bit RGBA value to this, divide each component by 255.

Floating-point RGBA values, where 0 >= element <= 1.
Does it have website show the color code?

Does it have website show the color code?

To convert a regular 8-bit RGBA value to this, divide each component by 255.


If I want use this color code (Breeze) 146 223 227
how I put this colors[0] = "0 146 223 227"; or I am wrong.

how I put this colors[0] = "0 146 223 227"; or I am wrong.

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

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
Oh stuff, I am idiot of math colors. How I can figure it out? use the calculator or what?

Oh stuff, I am idiot of math colors. How I can figure it out?

#1: Read my post.
#2: Done.

use the calculator or what?

You decide.

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.

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.

Divide each component of the RGBA value by 255 and use a list of the results separated by space for the color[0] value.

I look at the script lights code:

1 1 1 1=White
1 0 0 1=Red
1 0 1 1=Purple
0 0 1 1=Blue
0 1 1 1=Cyan
0 1 0 1=Green
1 1 0 1=Yellow
1 0.5 0 1=Orange
1 0 0.8 1=Hot Pink
0.8 0.7 0.4 1=Gold
1 0.7 0.8 1=Light Pink
1 0 0.8 1=hot Pink Light
0.6 0.5 1 1=Lavendar Light
0.6 1 0.5 1=Mint Green Light
1 0.8 0.5 1=Peach Light
0 0.6 1 1=Sky Blue Light
0.6 1 0.1 1=Lime Green Light
0.8 0.7 0.4 1=Candle Light
0.93 0.92 0.60 1=Bulb Light

I want know how these number come up?
« Last Edit: May 14, 2012, 08:23:46 AM by Cubelands »

I look at the script lights code:

1 1 1 1=white
1 0 0 1=red
1 0 1 1=purple
0 0 1 1=blue
0 1 1 1=cyan
0 1 0 1=green
1 1 0 1=yellow
1 0.5 0 1=orange
1 0 0.8 1=hot pink

I want know how these number come up?

Read my previous posts.