Create a lighter/darker color based on a OpenXml color

How to get HEX value of Excel theme colors (e.g. Accent6, Darker25%) using OpenXML? I have tried following code:

  public static System.Drawing.Color ChangeColorHexValue(System.Drawing.Color color, float tintsValue)
    {
        float red = (float)color.R;
        float green = (float)color.G;
        float blue = (float)color.B;
        if (tintsValue < 0)
        {
            tintsValue = 1 + tintsValue;
            red *= tintsValue;
            green *= tintsValue;
            blue *= tintsValue;
        }
        else
        {
            red = (255 - red) * tintsValue + red;
            green = (255 - green) * tintsValue + green;
            blue = (255 - blue) * tintsValue + blue;
        }
        return System.Drawing.Color.FromArgb(color.A, (int)red, (int)green, (int)blue);
    }

I’m not exactly sure what you would like to achieve, but to correctly darken a color a certain percent I would convert it to HSV space, change the V value as required, and then convert back. Here is an open source HSV color implementation for Unity: A HSV Color struct for Unity3D. Allows conversion between UnityEngine.Color and UnityEngine.Color32. · GitHub