Is there a way to add/subtract Color3 values to BackgroundColor3 values in GUI items?
Addition:
local Pixels = Leg1:GetChildren() for i = 1, #Pixels do Pixels[i].BackgroundColor3 = Color3.new(256,256,256) + Pixels[i].BackgroundColor3 end
14:01:06.842 - Plugin_144415441.SkinModelPlugin:122: attempt to perform arithmetic on a userdata value
To do this, we need to first understand what Color3 is.
Wiki Definition: A real-valued RGB color tuple, with elements ranging from [0,1]. The Color3 data type is often used in setting the colors of objects that aren't related to bricks, such as GUIs, Sparkles, etc.
RGB (Red, Green, Blue) are the 3 main colors in ROBLOX. Messing with the Red, Green, and Blue values, is what gives you colors such as Pink, Yellow, Etc...
Knowing that, we can move on to how setting a Color3 works;
script.Parent.BackgroundColor3 = Color3.new(Red, Green, Blue)
Knowing that Color3's are setup like that, we can now try to subtract each value:
game.StarterGui.ScreenGui.Frame.BackgroundColor3 = Color3.new((game.StarterGui.ScreenGui.Frame.BackgroundColor3.r - 1)/255, (game.StarterGui.ScreenGui.Frame.BackgroundColor3.g - 1)/255, (game.StarterGui.ScreenGui.Frame.BackgroundColor3.b - 1)/255)
Sources: http://wiki.roblox.com/index.php?title=Color3