PcoWSkbVqDnWTu_dm2ix
We use cookies on this site to enhance your user experience
Collapse Sidebar

Color3

Decal

Color3

The DataType/Color3 tint of the Decal.

Developers should note that this property only sets the tint of the decal, rather than the color. This means, unless the image associated with the Decal was originally white (RGB = 1,1,1) then the color cannot be freely changed using this property.

By reducing the RGB properties of DataType/Color3 in union, developers can make a decal darker.


Code Samples


Decal Color3

This code sample creates a Decal in the workspace and changes its Decal/Color3 property on a loop using TweenService.

local TweenService = game:GetService("TweenService")

-- create part 1
local part = Instance.new("Part")
part.Size = Vector3.new(10, 10, 1)
part.Position = Vector3.new(0, 5, 0)
part.Anchored = true
part.Transparency = 1

-- create decal
local decal = Instance.new("Decal", part)
decal.Face = Enum.NormalId.Front
decal.Texture = "http://www.roblox.com/asset/?id=1145367640" -- white circle

-- add to workspace
part.Parent = workspace

-- create tweens
local redTween = TweenService:Create(decal, 
	TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
	{Color3 = Color3.new(1, 0, 0)}
)
local greenTween = TweenService:Create(decal, 
	TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
	{Color3 = Color3.new(0, 1, 0)}
)
local blueTween = TweenService:Create(decal, 
	TweenInfo.new(1, Enum.EasingStyle.Linear, Enum.EasingDirection.Out),
	{Color3 = Color3.new(0, 0, 1)}
)

-- play tweens
while true do
	redTween:Play()
	redTween.Completed:Wait()
	greenTween:Play()
	greenTween.Completed:Wait()
	blueTween:Play()
	blueTween.Completed:Wait()
end