|
| 03 Dec 2016 09:10 PM |
Here is wonderful challenge to get you thinking, if "0,0,0" (Black) is the opposite color of "255,255,255" (White). Then how would you find the opposite of any other color?
If you can, try writing a formula.
First winner gets a prize, lmao. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:15 PM |
| Hmmm, I guess no one is smart enough to answer my riddle. ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:15 PM |
function opposite(r, g, b) return Color3.r - 255 return Color3.g - 255 return Color3.b - 255 end
idk lol
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:17 PM |
| ^ That wouldn't work, because you would get a negative number if r,g, or b was less than 255, which kinda defeats the purpose. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:18 PM |
try #2
function oppositeColor(r, g, b) return r = r - 255 return g = g - 255 return b = b - 255 end
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:21 PM |
| ^ That does essentially the same thing, you don't really have to use Lua, you can make a regular algebra equation with steps if its easier. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:25 PM |
try #3
function oppositeColor(r, g, b) if r < 255 then return r = r - 255 * -1 else return r = r - 255 if g < 255 then return g = g - 255 * -1 else return g = g -255 if b < 255 then return b = b - 255 * -1 else return b = b - 255 end
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:28 PM |
oops, forgot to add the ends
function oppositeColor(r, g, b) if r < 255 then return r = r - 255 * -1 else return r = r - 255 if g < 255 then return g = g - 255 * -1 else return g = g -255 if b < 255 then return b = b - 255 * -1 else return b = b - 255 end end end end
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:33 PM |
| ^ There are no negative numbers in 8-bit binary. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:35 PM |
don't bind me to binary!!
huehue... i came up with a good joke...
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 03 Dec 2016 09:40 PM |
| ########################################################################################################## |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Dec 2016 09:41 PM |
r' = 255 - r g' = 255 - g b' = 255 - b
??? |
|
|
| Report Abuse |
|
|
Exzeption
|
  |
| Joined: 01 Nov 2011 |
| Total Posts: 1312 |
|
|
| 03 Dec 2016 09:42 PM |
rip... They would have to add up to 255. -1 and 1 add up to 0, etc., and in this case 0 and 255 add up to 255. So it would be two colors whose values add up to 255,255,255.
Color3.new(1,1,1)-Color
~The Low Brass Master |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 03 Dec 2016 09:46 PM |
Assuming r,g,b have a range of 0-255 each print((function(r,g,b) return 255-r, 255-g, 255-b end)(128,0,255))
|
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:47 PM |
casualist came back to life!
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
Casualist
|
  |
| Joined: 26 Jun 2014 |
| Total Posts: 4443 |
|
|
| 03 Dec 2016 09:49 PM |
| Kinda sorta. I appear on the forums when I don't want to be productive. Which if anyone has noticed is increasing as finals are drawing near. |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 Dec 2016 09:51 PM |
Well I see the others have posted the right answer... Always ahead of me
255-r 255-g 255-b
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:51 PM |
Well think of this, "255,0,255" is the opposite of "0,255,0". Hope this hint gives ya an idea of some sort. |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:52 PM |
| Oh wait, holy crap, I didn't even notice you got it right. |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Dec 2016 09:52 PM |
yeah same I got an eight page research paper plus I work also we had the same solution (this is a really basic challenge) |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:52 PM |
i still get a prize for being the first one to try, right? :<
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
caca50
|
  |
| Joined: 10 Jul 2011 |
| Total Posts: 2037 |
|
|
| 03 Dec 2016 09:53 PM |
Finals buddies!
I got two online finals due tomorrow, but see where I am?
Roblox.Forum.Scripters:1: bad argument #1 to 'intellect' (number expected, got nil) |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Dec 2016 09:53 PM |
| oh yea speaking of which I was the first to get it right wasn't I? what's the prize?? |
|
|
| Report Abuse |
|
|
|
| 03 Dec 2016 09:53 PM |
also, putting it in to a function:
function oppositeColor(r, g, b) return 255 - r return 255 - g return 255 - b end
attempt to call girlfriend (a nil value) | nothin' like a good argument ¯\_(ツ)_/¯ |
|
|
| Report Abuse |
|
|
lordrambo
|
  |
| Joined: 16 Jun 2009 |
| Total Posts: 20628 |
|
|
| 03 Dec 2016 09:55 PM |
| you can't return three times, however you can return a tuple of all three number values if you should so wish to |
|
|
| Report Abuse |
|
|