When ApplyDescription is called, BodyColors are absurd

So I have this little code that should set clothes and body colors to a Dummy inside a viewport frame:

local Dictionary = {
	["Henry"] = {
		["Color"] = Color3.fromRGB(0,0,0),
		["Class"] = "Aelita",
		["Level"] = 30,
		["XP"] = 0,
		["Types"] = {
			["Earth"] = {
				["BodyColor"] = Color3.new(255,255,255),
				["Hat"] = 7485912398,
				["Hair"] = 7222634196,
				["Back1"] = 9057436918,
				["Back2"] = 12415262955,
				["Waist"] = 6544500041,
			},
			--[[["Lyoko"] = {
				["Waist"] = 1,
				["Hair"] = 2,
			},
			["Xana"] = {
				["Waist"] = 1,
				["Hair"] = 2,
			}]]
		},
	},
}

for OutfitDisplayName,Content in pairs(Dictionary) do
	local OutfitDetails = script.OutfitChooserDetails:Clone()
	local OutfitField = OutfitChooser["Outfit"..tostring(OutfitIndex)]
	OutfitField.Visible = true
	OutfitField.Parent.Visible = true
	local TempDescription = Instance.new("HumanoidDescription")
	
	print(Content.Types.Earth.BodyColor)
	TempDescription.HeadColor = Content.Types.Earth.BodyColor
	TempDescription.LeftArmColor = Content.Types.Earth.BodyColor
	TempDescription.RightArmColor = Content.Types.Earth.BodyColor
	TempDescription.TorsoColor = Content.Types.Earth.BodyColor
	TempDescription.LeftLegColor = Content.Types.Earth.BodyColor
	TempDescription.RightLegColor = Content.Types.Earth.BodyColor
	
	TempDescription.HatAccessory = Content.Types.Earth.Hat
	TempDescription.HairAccessory = Content.Types.Earth.Hair
	TempDescription.BackAccessory = ("%s,%s"):format(Content.Types.Earth.Back1,Content.Types.Earth.Back2)
	TempDescription.WaistAccessory = Content.Types.Earth.Waist
	OutfitDetails.Parent = OutfitField
	for _,Detail in ipairs(OutfitDetails:GetChildren()) do
		Detail.Parent = OutfitDetails.Parent
	end
	OutfitDetails:Destroy()
	OutfitField.Avatar.Dummy.Humanoid:ApplyDescription(TempDescription)
	TempDescription:Destroy()
end

Now, I observe that everything goes as it should, except for the BodyColors. They are pitch black and when looking at their Color property I see this:


What is going on? The print in the code outputs exactly what it should: 255,255,255

Also to note that by trying Color3.new() instead of Color3.fromRGB() it works as it should. Why is this

Color3.new expects each argument to be divided by 255 (so a number between 0 and 1 for expected results). So Color3.new(255, 255, 255) is essentially the same as doing Color3.fromRGB(255 * 255, 255 * 255, 255 * 255), which is 65025 which explains the colour you’re getting.

Yeah uhh, thanks for showing me that I was using Color3.new instead of Color3.fromRGB. I was expecting to make a stupid mistake and ohwell, there it is. :sweat_smile:

1 Like

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.