Exemple #1
0
 /// <summary>
 /// Converts the color to a linear color.
 /// </summary>
 /// <returns>A linear RGB color</returns>
 public ColorRGB ToLinear()
 {
     if (SpaceName != RGBSpaceName.ICC)
     {
         if (!IsLinear)
         {
             return(new ColorRGB(SpaceName, Space.ToLinear(R), Space.ToLinear(G), Space.ToLinear(B), true));
         }
         else
         {
             return(this);
         }
     }
     else
     {
         return(this);
     }
 }
Exemple #2
0
 /// <summary>
 /// Converts the color to a linear color.
 /// </summary>
 /// <returns>A linear RGB color</returns>
 public BColorRGB ToLinear()
 {
     if (SpaceName != RGBSpaceName.ICC)
     {
         if (!IsLinear)
         {
             return(new BColorRGB(SpaceName, (byte)(Space.ToLinear(R) * 255), (byte)(Space.ToLinear(G) * 255), (byte)(Space.ToLinear(B) * 255), true));
         }
         else
         {
             return(this);
         }
     }
     else
     {
         return(this);
     }
 }
Exemple #3
0
 /// <summary>
 /// Converts the color to a linear color.
 /// </summary>
 /// <returns>A linear RGB color</returns>
 public UColorRGB ToLinear()
 {
     if (SpaceName != RGBSpaceName.ICC)
     {
         if (!IsLinear)
         {
             return(new UColorRGB(SpaceName, (ushort)(Space.ToLinear(R) * 65535), (ushort)(Space.ToLinear(G) * 65535), (ushort)(Space.ToLinear(B) * 65535), true));
         }
         else
         {
             return(this);
         }
     }
     else
     {
         return(this);
     }
 }