# C1.Util.DX.ColorF.-ctor

## Content

<div class="doc-site-dotnet-api-container">



<h1 id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*">ColorF Constructor
</h1>
<div class="markdown level0 summary"></div>
<div class="markdown level0 conceptual"></div>



<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_Single_" data-uid="C1.Util.DX.ColorF.#ctor(System.Single)">ColorF(float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(float value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The value that will be assigned to all components.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_Single_System_Single_System_Single_System_Single_" data-uid="C1.Util.DX.ColorF.#ctor(System.Single,System.Single,System.Single,System.Single)">ColorF(float, float, float, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(float red, float green, float blue, float alpha = 1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(red As Single, green As Single, blue As Single, Optional alpha As Single = 1)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">red</span></td>
      <td><p>The red component of the color.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">green</span></td>
      <td><p>The green component of the color.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">blue</span></td>
      <td><p>The blue component of the color.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">alpha</span></td>
      <td><p>The alpha component of the color.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_UInt32_" data-uid="C1.Util.DX.ColorF.#ctor(System.UInt32)">ColorF(uint)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[CLSCompliant(false)]
public ColorF(uint argb)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;CLSCompliant(False)&gt;
Public Sub New(argb As UInteger)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></td>
      <td><span class="parametername">argb</span></td>
      <td><p>A packed unsigned integer containing all four color components in ARGB order.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_UInt32_System_Single_" data-uid="C1.Util.DX.ColorF.#ctor(System.UInt32,System.Single)">ColorF(uint, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">[CLSCompliant(false)]
public ColorF(uint rgb, float alpha)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">&lt;CLSCompliant(False)&gt;
Public Sub New(rgb As UInteger, alpha As Single)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.uint32">uint</a></td>
      <td><span class="parametername">rgb</span></td>
      <td><p>A packed unsigned integer containing three color components in RGB order.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">alpha</span></td>
      <td><p>The alpha component of the color.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_C1_Util_DX_ColorF_System_Single_" data-uid="C1.Util.DX.ColorF.#ctor(C1.Util.DX.ColorF,System.Single)">ColorF(ColorF, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(ColorF value, float alpha = 1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As ColorF, Optional alpha As Single = 1)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The source ColorF.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">alpha</span></td>
      <td><p>The alpha component of the color.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_Windows_Media_Color_" data-uid="C1.Util.DX.ColorF.#ctor(System.Windows.Media.Color)">ColorF(Color)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(Color color)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(color As Color)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.windows.media.color">Color</a></td>
      <td><span class="parametername">color</span></td>
      <td><p>The System.Windows.Media.Color value.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_C1_Util_DX_Vector3_System_Single_" data-uid="C1.Util.DX.ColorF.#ctor(C1.Util.DX.Vector3,System.Single)">ColorF(Vector3, float)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(Vector3 value, float alpha = 1)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Vector3, Optional alpha As Single = 1)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Vector3.html">Vector3</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The red, green, and blue components of the color.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a></td>
      <td><span class="parametername">alpha</span></td>
      <td><p>The alpha component of the color.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_C1_Util_DX_Vector4_" data-uid="C1.Util.DX.ColorF.#ctor(C1.Util.DX.Vector4)">ColorF(Vector4)</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(Vector4 value)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(value As Vector4)</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="C1.Util.DX.Vector4.html">Vector4</a></td>
      <td><span class="parametername">value</span></td>
      <td><p>The red, green, blue, and alpha components of the color.</p>
</td>
    </tr>
  </tbody>
</table>


<a id="C1_Util_DX_ColorF__ctor_" data-uid="C1.Util.DX.ColorF.#ctor*"></a>
<h4 id="C1_Util_DX_ColorF__ctor_System_Single___" data-uid="C1.Util.DX.ColorF.#ctor(System.Single[])">ColorF(float[])</h4>
<div class="markdown level1 summary"><p>Initializes a new instance of the <a class="xref" href="C1.Util.DX.ColorF.html">ColorF</a> struct.</p>
</div>
<div class="markdown level1 conceptual"></div>
<h5 class="declaration">Declaration</h5>
<div class="codewrapper">
  <pre><code class="lang-csharp hljs">public ColorF(float[] values)</code></pre>
</div>
<div class="codewrapper">
  <pre><code class="lang-vbnet hljs">Public Sub New(values As Single())</code></pre>
</div>
<h5 class="parameters">Parameters</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Name</th>
      <th>Description</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.single">float</a>[]</td>
      <td><span class="parametername">values</span></td>
      <td><p>The values to assign to the red, green, blue, and alpha components of the color. This must be an array with four elements.</p>
</td>
    </tr>
  </tbody>
</table>
<h5 class="exceptions">Exceptions</h5>
<table class="table table-bordered table-condensed">
  <thead>
    <tr>
      <th>Type</th>
      <th>Condition</th>
    </tr>
  </thead>
  <tbody>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentnullexception">ArgumentNullException</a></td>
      <td><p>Thrown when <code class="paramref">values</code> is <code>null</code>.</p>
</td>
    </tr>
    <tr>
      <td><a class="xref" href="https://learn.microsoft.com/dotnet/api/system.argumentoutofrangeexception">ArgumentOutOfRangeException</a></td>
      <td><p>Thrown when <code class="paramref">values</code> contains more or less than four elements.</p>
</td>
    </tr>
  </tbody>
</table>
</div>
