Why does this keep turning my block white? I am trying to set it to a darker shade of green…
local color = BrickColor.new("Lime green")
local sub = 0.1
local darkershade = Color3.new(color.Color.R-sub,color.Color.G-sub,color.Color.B-sub)
local tweenService = game:GetService("TweenService")
local tweenInformation = TweenInfo.new(6) -- Time1
local ColorProperty = {}
ColorProperty.Color = color.Color
local ColorProperty2 = {}
ColorProperty2.Color = darkershade
local tween1 = tweenService:Create(game.Workspace["Roblox Logo"].Logo,tweenInformation,ColorProperty) --create a smooth transsition
tween1:Play() --play the transition.
local tween2 = tweenService:Create(game.Workspace["Roblox Logo"].Back,tweenInformation,ColorProperty2) --create a smooth transsition
tween2:Play() --play the transition.
It has something to do with tween Service. How can I fix this problem?
local color = BrickColor.new("Lime green")
local sub = 0.1
local darkershade = Color3.fromRGB(color.Color.R-sub,color.Color.G-sub,color.Color.B-sub)
local tweenService = game:GetService("TweenService")
local tweenInformation = TweenInfo.new(6) -- Time1
local ColorProperty = {}
ColorProperty.Color = color.Color
local ColorProperty2 = {}
ColorProperty2.Color = darkershade
local tween1 = tweenService:Create(game.Workspace["Roblox Logo"].Logo,tweenInformation,ColorProperty) --create a smooth transsition
tween1:Play() --play the transition.
tween1.Completed:Wait()
local tween2 = tweenService:Create(game.Workspace["Roblox Logo"].Back,tweenInformation,ColorProperty2) --create a smooth transsition
tween2:Play() --play the transition.
Still didnt work? I am pretty sure both solutions are included right?
The reason the part is turning white is because you’re subtracting from each color channel and getting a number smaller than 0. Try a math.clamp() on each color channel. The color you’re getting is: -0.1, 0.9, -0.1
local color = BrickColor.new("Lime green")
local sub = 0.1
local darkershade = Color3.fromRGB((color.r-sub)*255,(color.g-sub)*255, (color.b-sub)*255)
local tweenService = game:GetService("TweenService")
local tweenInformation = TweenInfo.new(6)
local ColorProperty = {}
ColorProperty.Color = color.Color
local ColorProperty2 = {}
ColorProperty2.Color = darkershade
local tween1 = tweenService:Create(game.Workspace["Roblox Logo"].Logo,tweenInformation,ColorProperty)
tween1:Play()
tween1.Completed:Wait()
local tween2 = tweenService:Create(game.Workspace["Roblox Logo"].Back,tweenInformation,ColorProperty2)
tween2:Play()