PuzzleGame/PuzzleGameProject/Assets/Scripts/ColorUtility.cs
2025-01-19 14:06:07 +01:00

18 lines
544 B
C#

using UnityEngine;
public static class ColorUtility
{
public static Color AddGreyShade(Color originalColor, float greyIntensity)
{
// Clamp the greyIntensity between 0 and 1
greyIntensity = Mathf.Clamp01(greyIntensity);
// Define the grey color (e.g., medium grey)
Color grey = new Color(0.5f, 0.5f, 0.5f); // RGB (128, 128, 128)
// Blend the original color with the grey color
Color blendedColor = Color.Lerp(originalColor, grey, greyIntensity);
return blendedColor;
}
}