|
| 07 Oct 2015 09:12 PM |
Can I obtain a simplified goal of adding two color3 values?
Color3.new(0,.5,0)+Color3.new(1,0,0)
So... I'm in no position to test it right now, but I was wondering if you can actually do this. |
|
|
| Report Abuse |
|
|
| |
|
|
| 07 Oct 2015 09:14 PM |
Im not sure about that way,
But im positive you can add the individual values together.
Color1 = Color3.new(1,1,1) Color2 = Color3.new(2,2,2)
Color3 = Color3.new(Color1.r+Color2.r,Color1.g+Color2.g,Color1.b+Color2.b) |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2015 09:14 PM |
I don't think so.
-The [Guy] |
|
|
| Report Abuse |
|
|
|
| 07 Oct 2015 09:16 PM |
| Alright. I wish this Lua had some better features like C++ |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 07 Oct 2015 09:59 PM |
'Alright. I wish this Lua had some better features like C++' LFMAO you obviously don't know Lua enough, you can easily have this possible with metatables, you blame Roblox not Lua for this. |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2015 11:51 AM |
'this Lua'
Sorry if you didn't notice that before. I realize ROBLOX has their own flavor. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 08 Oct 2015 11:57 AM |
You can still do it in rbx lua though, you do vec3+vec3 all the time. It's just that roblox didn't feel like we need col3+col3 |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2015 12:20 PM |
You can simply wrap the object.
local color3 = Color3 local Color3 = {}
Color3.new = function(...) local c3 = color3.new(...) local this = {} --TODO: Make a proxy? meh.. this.Orig = c3 setmetatable(this, { __index = this.Orig; __newindex = function(a,b,c) this.Orig[b] = c end; __add = function(a,b) this.Orig[b] = Color3.new(this.Orig[b].R + b.R, this.Orig[b].G + b.G, this.Orig[b].B + b.G) end }) return this end
May not work. I expect it not to because I half assly made it. |
|
|
| Report Abuse |
|
|
eLunate
|
  |
| Joined: 29 Jul 2014 |
| Total Posts: 13268 |
|
|
| 08 Oct 2015 01:58 PM |
Oh jeez don't simply wrap the object. You'd have to wrap all the other objects too. If you want it 'native', there's support for it in Valkyrie's Design Library.
Otherwise, just add the individual values of the r,g,b together. |
|
|
| Report Abuse |
|
|
Goulstem
|
  |
| Joined: 04 Jul 2012 |
| Total Posts: 7177 |
|
|
| 08 Oct 2015 02:05 PM |
function add(c1,c2) local r,g,b = c1.r,c1.g,c1.b; local r1,g1,b1 = c2.r,c2.g,c2.b; return Color3.new(r+r1,g+g1,b+b1); end |
|
|
| Report Abuse |
|
|
|
| 08 Oct 2015 02:10 PM |
wow
[http://www.roblox.com/Naruto-Shippuuden-Sasuke-Theme-1-item?id=159498348] |
|
|
| Report Abuse |
|
|