As a Roblox developer, I want to perform math directly on Color3 values, because it is more convenient than converting between data types.
If Roblox is able to address this issue, it would improve my development experience because there would be no more need to convert Color3s to Vector3s to do simple math on Color3 values.
Color3s and Vector3s are extremely similar but Color3s lack so many of the features that Vector3s have.
I propose that Vector3 math is applied to Color3s values. Additionally, or in place the above, I propose the following methods be added:
Color3 Color3.fromVector3(Vector3 color)
Vector3 Color3:ToVector3()
These methods simply treat r as x, g as y, and b as z.
Examples:
local color = Color3.fromVector3(Vector3.new(255, 127, 0)/255) -- Orange
color = color + Color3.new(0, -0.5, 1) -- Magenta
-- Possibly?
color = color - Vector3.new(0, -0.5, 1) -- Back to orange?
color = color:ToVector3() -- 1, 0.5, 0
This form of Vector3 math/conversion could be used to visualize values and easily convert between color and position. It also allows Roblox to partially merge the functionality of Vector3s and Color3s which can reduce the amount of work needed to be done when updating Color3s.
This form of math is also much easier to type and to read.
-- Before
local colorAddVector = Color3.new(color.r+vector.x, color.g+vector.y, color.b+vector.z)
-- After
local colorAddVector = color+vector
-- Before
local color = Color3.new(0.65, 0.45, 0.55)
color = Color3.new(color.r/2, color.g/2, color.b/2) -- Half as bright
-- After
local color = Color3.new(0.65, 0.45, 0.55)
color = color/2 -- Half as bright