I’m trying to find a way to find the median of 2 color3 values using only code, but I have not found a way to do so.
I’ve tried using tweens and stopping it mid way to get the color value, but it’s inconsistent.
local tweenService = game:GetService("TweenService")
local debris = game:GetService("Debris")
function getMedianColor(color1,color2)
local new = Instance.new("Part")
new.Parent = workspace
debris:AddItem(new,1)
new.Color = color1
local tween = tweenService:Create(new,TweenInfo.new(1),{Color = color2})
tween:Play()
task.wait(.5)
tween:Pause()
return new.Color
end
--Expected output = 0.5,0.5,0.5
print(getMedianColor(Color3.new(0,0,0),Color3.new(1,1,1)))
How can I make a consistent way to get the median color?