Ejemplo n.º 1
0
 /// <summary>
 /// Gets 8-bit binary representation of a <see cref="Rgb"/> as string
 /// </summary>
 /// <param name="rgb"></param>
 /// <returns></returns>
 public static (string rBinary, string gBinary, string bBinary) BinaryRepresentationOfColor(this Rgb rgb)
 {
     var(r, g, b) = rgb.GetRgb();
     return(
         Convert.ToString(r, 2).PadLeft(8, '0'),
         Convert.ToString(g, 2).PadLeft(8, '0'),
         Convert.ToString(b, 2).PadLeft(8, '0')
         );
 }