Skip to content

Commit a742fdb

Browse files
committed
update rarity and border colors
1 parent 9b54255 commit a742fdb

File tree

1 file changed

+12
-11
lines changed

1 file changed

+12
-11
lines changed

UnityHiroInventory/Assets/UnityHiroInventory/Scripts/HiroInventoryController.cs

Lines changed: 12 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -292,7 +292,7 @@ private void PopulateInventoryGrid()
292292
{
293293
if (selectedItem != item)
294294
{
295-
Color hoverColor = new Color(rarityColor.r, rarityColor.g, rarityColor.b, 0.5f);
295+
Color hoverColor = new Color(rarityColor.r, rarityColor.g, rarityColor.b, 0.8f);
296296
slotRoot.style.backgroundColor = new StyleColor(hoverColor);
297297
slotRoot.style.borderTopColor = new StyleColor(Color.white);
298298
slotRoot.style.borderBottomColor = new StyleColor(Color.white);
@@ -323,11 +323,12 @@ private Color GetRarityColor(string rarity)
323323
{
324324
return rarity switch
325325
{
326-
"common" => new Color(0.6f, 0.6f, 0.6f, 0.3f), // Gray
327-
"uncommon" => new Color(0.2f, 0.8f, 0.2f, 0.3f), // Green
328-
"epic" => new Color(0.6f, 0.3f, 0.9f, 0.3f), // Purple
329-
"legendary" => new Color(1f, 0.6f, 0f, 0.3f), // Orange/Gold
330-
_ => new Color(0.52f, 0.6f, 1f, 0.1f) // Default blue
326+
"common" => new Color(0.541f, 0.714f, 0.965f, 1.0f),
327+
"uncommon" => new Color(0.784f, 0.875f, 0.478f, 1.0f),
328+
"rare" => new Color(0.647f, 0.533f, 0.965f, 1.0f),
329+
"epic" => new Color(0.992f, 0.878f, 0.373f, 1.0f),
330+
"legendary" => new Color(1f, 0.584f, 0.573f, 1.0f),
331+
_ => new Color(0.745f, 0.722f, 0.855f, 1.0f) // Default color
331332
};
332333
}
333334

@@ -376,11 +377,11 @@ private void SelectItem(IInventoryItem item, VisualElement slot)
376377
selectedItem = item;
377378
selectedSlot = slot;
378379

379-
// Highlight selected slot with gold border (keeping the rarity background)
380-
slot.style.borderTopColor = new StyleColor(new Color(1f, 0.84f, 0f));
381-
slot.style.borderBottomColor = new StyleColor(new Color(1f, 0.84f, 0f));
382-
slot.style.borderLeftColor = new StyleColor(new Color(1f, 0.84f, 0f));
383-
slot.style.borderRightColor = new StyleColor(new Color(1f, 0.84f, 0f));
380+
// Highlight selected slot with turquoise border (keeping the rarity background)
381+
slot.style.borderTopColor = new StyleColor(new Color(0.467f, 0.984f, 0.937f));
382+
slot.style.borderBottomColor = new StyleColor(new Color(0.467f, 0.984f, 0.937f));
383+
slot.style.borderLeftColor = new StyleColor(new Color(0.467f, 0.984f, 0.937f));
384+
slot.style.borderRightColor = new StyleColor(new Color(0.467f, 0.984f, 0.937f));
384385

385386
UpdateActionButtons();
386387

0 commit comments

Comments
 (0)