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
   
ROBLOX Forum » Roblox » Virtual BLOXcon Hackathon
Home Search
 

Re: I believe my hackathon entry is correct.. Is it?

Previous Thread :: Next Thread 
SigmaTech is not online. SigmaTech
Joined: 28 Jan 2010
Total Posts: 643
21 Jun 2014 04:23 PM
http://www.roblox.com/SigmaTechs-Hackathon-Entry-place?id=162505999

->Bricks around a sphere get their colors inverted (I did this by subtracting the existing color3 value of each color multiplied by 255. [ex. r*255], then I divided the whole thing by 255.

..And if there's an even amount of spheres, it cancels out

->Bricks around a cylinder don't change.

..And if there's an even amount of cylinders, it cancels out
Report Abuse
SigmaTech is not online. SigmaTech
Joined: 28 Jan 2010
Total Posts: 643
21 Jun 2014 04:24 PM
Correction for the color inversion thing

I did this by subtracting the existing color3 value of each color multiplied by 255 [ex. r*255] from 255, then I divided the whole thing by 255.
Report Abuse
SigmaTech is not online. SigmaTech
Joined: 28 Jan 2010
Total Posts: 643
21 Jun 2014 04:38 PM
So formula for color inversion:

Let's focus on one color. We'll stick with red.

You HAVE to make your color values divided by 255 all the time for them to work. Otherwise you'll have to type one's and zero's. (Black and white)

existingColor = Color3.new(4/255,234/255,123/255)

1) You take the existing value

existingColor.r

2) Multiply it by 255 to get an out-of 255 number

existingColor.r*255

3) Subtract the value from 255.

255 - existingColor.r*255

4)Divide the whole thing by 255 to put it in.

(255-existingColor.r*255)/255

F) This is an example result of one color in Color3.
Report Abuse
flump is not online. flump
Joined: 30 Jul 2008
Total Posts: 1039
21 Jun 2014 05:01 PM
Color.r is given as a percentage of 0 - 255 (0 = 0) (1 = 255) (.5 = 127.5)

so instead of * the Color.r by 255 and then taking the result away from 255 why not skip a step and just take Color.r away from 1

lets say Color.r = .75

so Color.r * 255 = 191.25
255 - 191.25 = 63.75
63.75/255 0 .25
which is correct

but you could do
1 - Color.r = .25
1 - .75 = .25

Hope this helps making your code more efficent



Report Abuse
leatherwork is not online. leatherwork
Joined: 19 Jun 2010
Total Posts: 7945
21 Jun 2014 05:09 PM
ima copy u

jk
Report Abuse
SigmaTech is not online. SigmaTech
Joined: 28 Jan 2010
Total Posts: 643
21 Jun 2014 06:36 PM
@Flump

Yeah. I saw someone else say this and I said "Derp."

255/255 = 1

154/255 = 0.something

Yeh.

I was in a rush in hackathon. The scripts have the lowest efficiency ever. There was no need to make it efficient, because seriously, I'm not going to get like 100 visitors.
Report Abuse
GroovyLine91 is not online. GroovyLine91
Joined: 05 May 2012
Total Posts: 3315
21 Jun 2014 07:26 PM
Lol
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Roblox » Virtual BLOXcon Hackathon
   
 
   
  • 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