Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

how do i fix my color3 values from multiplying?

Asked by 4 years ago

i have a script that changes the atmosphere's color, this is the script

game.Lighting.Atmosphere.Color = Color3.new(16,0,83)

but whenever i run the game, the atmosphere's color ends up being "4080, 0, 21165" so it's just an intensely bright pink

is it possible to make it become the EXACT color3 value i specify?

the color is supposed to change, so i cant just change it manually

0
Just use Color3.fromRGB(15, 0, 83) Xx_XSanderPlayXx 160 — 4y

2 answers

Log in to vote
1
Answered by
Vid_eo 126
4 years ago
Edited 4 years ago

There are two possible ways to do this:

game.Lighting.Atmosphere.Color3 = Color3.new(16/255, 0/255, 83/255) --this divides the Color3 values by 255 (which is the highest RGB value you can have)

or

game.Lighting.Atmosphere.Color3 = Color3.fromRGB(16, 0, 83) --this basically gets the color3 from the RGB values you input, which are whole numbers (which is what you wanted to do

If this helps, please accept it as the answer!

Ad
Log in to vote
0
Answered by
Fifkee 2017 Community Moderator Moderation Voter
4 years ago

Color3.new expects values from a range of 0 to 1. Instead, you should use Color3.fromRGB(), which takes values from 0 to 255.

Answer this question