generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
We use cookies to offer you a better experience. By using Roblox.com, you are agreeing to our Privacy and Cookie Policy.
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Color3...

Previous Thread :: Next Thread 
blimp80 is not online. blimp80
Joined: 22 May 2011
Total Posts: 278
16 Mar 2016 12:22 PM
Is there a way to transition a color3 value rather than just changing it? Like fading from 0,0,0 to 255,255,255?
And also, can you give color3 a brickcolor value? Like changing fog color to "Black"?
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
16 Mar 2016 12:26 PM
Here's my module for color transitions:
http://www.roblox.com/Color-Transitioning-Global-Function-item?id=358436403


And BrickColors have something called 'Color' so you can do this:

brickcolor.Color

Which returns the Color3 version of the brickcolor. I think.
Report Abuse
ByDefault is not online. ByDefault
Joined: 25 Jul 2014
Total Posts: 3197
16 Mar 2016 12:41 PM
@62GB

You over complicated that a lot

I wrote my own in 10 lines lol
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
16 Mar 2016 12:46 PM
You and I are different persons. Shush.
Report Abuse
blimp80 is not online. blimp80
Joined: 22 May 2011
Total Posts: 278
16 Mar 2016 01:11 PM
So basically, there is no simple way to have OutdoorAmbient smoothly transition as the time of day changes?
If there is, please tell me.
Seriously just like a repeat-until will be fine...
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
16 Mar 2016 01:19 PM
I posted my example.
Report Abuse
blimp80 is not online. blimp80
Joined: 22 May 2011
Total Posts: 278
16 Mar 2016 01:26 PM
And I looked at it.
Just seems like there should be a simpler, more efficient way
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
16 Mar 2016 01:29 PM
function Color3alpha(c1, c2, a)
return Color3.new(c1.r + (c2.r - c1.r) * a, c1.g + (c2.g - c1.g) * a, c1.b + (c2.b - c1.b) * a)
end

c1 being the first Color3 value, c2 being the second one, and 'a' being a number between 0 and 1.

0 would give you c1, 1 would give you c2, and .5 would give you halfway between the two.
You can have 'a' be any number between 0 and 1 though.

Have fun!
Report Abuse
blimp80 is not online. blimp80
Joined: 22 May 2011
Total Posts: 278
16 Mar 2016 01:36 PM
:o

:o

:o

:o

:o

:o

can i touch??
Report Abuse
blimp80 is not online. blimp80
Joined: 22 May 2011
Total Posts: 278
16 Mar 2016 02:11 PM
Okay, so what about making it fade to another color?
That function just gives me a color in between 2 colors.
I want to perform arithmetic on a color3 value.
Instead of

ambient = Color3.new(0,0,0)
wait()
ambient = Color3.new(1/255,1/255,1/255)
wait()
ambient = Color3.new(2/255,2/255,2/255)
wait()
so on....

I want to say

ambient = ambient + Color3.new(1/255,1/255,1/255)
until ambient is 255/255,255/255,255/255

but I cannot do that. Is there another way?
Report Abuse
FinalFunction is not online. FinalFunction
Joined: 18 Jun 2011
Total Posts: 48
16 Mar 2016 02:18 PM
You should be able to use Locard's code, and just increment 'a' within a loop as quickly or slowly as you want.
Report Abuse
62GB is not online. 62GB
Joined: 03 Oct 2011
Total Posts: 4157
16 Mar 2016 02:48 PM
for i = 0,1,.05 do
Color3Alpha()
wait()
end
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
16 Mar 2016 03:03 PM
62GB You'll never get to 1 using that sadly due to floating point precision errors. :(
It only goes up to

Try this:

for i = 0,100,5 do --Changed to whole numbers, which will definitely get to 100
Color3alpha(color3,color3,i*.01)
wait()
end

Should take roughly 2/3 + 1/30 second(s) to complete the coloring phase.
Report Abuse
Locard is not online. Locard
Joined: 13 Apr 2014
Total Posts: 3516
16 Mar 2016 03:04 PM
It only goes up to .95 *

Forgot I was typing a sentence there.
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image