Retieving a color value from a table

so i have a table that shows color3 values showing the color, but when i try retrieve the value i get returned with “expect brickcolor” or another that is regarding color, ive had a look around trying to figure it out, but i haven’t been able to solve it

the table

config.RarityColor = {
	Common = Color3.fromRGB(142, 144, 159),
	Uncommon = Color3.fromRGB(75, 216, 68),
	Rare = Color3.fromRGB(58, 193, 255),
	Epic = Color3.fromRGB(170, 0, 255),
	Legendary = Color3.fromRGB(255, 33, 63),
	Mythical = Color3.fromRGB(228, 20, 255),
}

the way i was getting the value of the table

config.RarityColor[pet.Parent.Name]
2 Likes

Can you give script of this line?

config.RarityColor[pet.Parent.Name]

I don’t think I get it.
Try show me your Explorer (optional)

petFrame.BackgroundColor3 = config.RarityColor[pet.Parent.Name]

so when you click on the pet it shows up like a info panel about the pet, but when the rarity of it in the backgroundcolor3, it never wants to change or refresh i guess

1 Like

Well as I see you try to set a Frame so this would work. But it won’t work on a brick if you try to set the brickcolor. You can’t get an error from expect brickcolor on UI. So I don’t see the problem here.

1 Like

Did you require the config? Also are you sure it is with a capital letter?

1 Like
selectFrame.UnitRarity.BackgroundColor3 = config.RarityColor[pet.Parent.Name]

this is the textlabel for it, the frame is for the one equipped so is shows the color in the slot, but when i set the color of it, it sets to just white, yes no capital either

the name of the unit changes to the color but the background of the unitinfo remains the color set in the studio

	petFrame.UnitName.TextColor3 = config.RarityColor[pet.Parent.Name]

this sets the name of the unit to the rarity of it, but on the info panel it shows red even if i click another one, if its green, white, or purple it remains red

in my gui it goes inventory>inventoryframe>unitinfo, which has the red background on the text

I don’t get it right now. I don’t get what you want right now. I think this would work.