# GrapeCity.Documents.Excel.ColorUtilities

## Content

<div class="doc-site-dotnet-api-container">



  <h1 id="GrapeCity_Documents_Excel_ColorUtilities" data-uid="GrapeCity.Documents.Excel.ColorUtilities" class="text-break">ColorUtilities Class
</h1>
  <div class="markdown level0 summary"><p>Provides utility methods for colors.</p>
</div>
  <div class="markdown level0 conceptual"></div>
  <div class="inheritance">
    <h5>Inheritance</h5>
    <div class="level0"><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.object">object</a></div>
    <div class="level1"><span class="xref">ColorUtilities</span></div>
  </div>
  <h6><strong>Namespace</strong>: <a class="xref" href="GrapeCity.Documents.Excel.html">GrapeCity.Documents.Excel</a></h6>
  <h6><strong>Assembly</strong>: DS.Documents.Excel.dll</h6>
  <h5 id="GrapeCity_Documents_Excel_ColorUtilities_syntax">Syntax</h5>
  <div class="codewrapper">
    <pre><code class="lang-csharp hljs">public static class ColorUtilities</code></pre>
  </div>
  <div class="codewrapper">
    <pre><code class="lang-vbnet hljs">Public Module ColorUtilities</code></pre>
  </div>
  <h3 id="methods">Methods
</h3>
  <table class="table table-bordered table-condensed">
    <thead>
      <tr>
        <th>Name</th>
        <th>Description</th>
      </tr>
    </thead>
    <tbody>
      <tr>
        <td id="GrapeCity_Documents_Excel_ColorUtilities_StringToColor_System_String_" data-uid="GrapeCity.Documents.Excel.ColorUtilities.StringToColor(System.String)">
          <a class="xref" href="GrapeCity.Documents.Excel.ColorUtilities.StringToColor.html#GrapeCity_Documents_Excel_ColorUtilities_StringToColor_System_String_">StringToColor(string)</a>
        </td>
        <td class="markdown level1 summary"><p>Converts a color string to a <a class="xref" href="https://learn.microsoft.com/dotnet/api/system.drawing.color">color structure</a>.<br>
The supported color string formats include:</p>
<ul><li><b>RGB format</b>: "rgb(r,g,b)", e.g., "rgb(255,0,0)" for red.</li><li><b>RGBA format</b>: "rgba(r,g,b,a)", e.g., "rgba(255,0,0,0.5)" for red with 50% opacity.</li><li><b>Hexadecimal</b>: "#RGB" or "#RRGGBB", e.g., "#F00" or "#FF0000" for red.</li><li><b>Hexadecimal with alpha</b>: "#RGBA" or "#RRGGBBAA", e.g., "#F00C" or "#FF0000CC" for red with 90% opacity.</li><li><b>Color name</b>: A predefined color name, e.g., "red".</li></ul>
</td>
      </tr>
    </tbody>
  </table>

</div>
