Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <pre><code>using System; using System.Drawing; public struct MyColor { private byte a, r, g, b; public byte A { get { return this.a; } } public byte R { get { return this.r; } } public byte G { get { return this.g; } } public byte B { get { return this.b; } } public MyColor SetAlpha(byte value) { this.a = value; return this; } public MyColor SetRed(byte value) { this.r = value; return this; } public MyColor SetGreen(byte value) { this.g = value; return this; } public MyColor SetBlue(byte value) { this.b = value; return this; } public int ToArgb() { return (int)(A &lt;&lt; 24) || (int)(R &lt;&lt; 16) || (int)(G &lt;&lt; 8) || (int)(B); } public override string ToString () { return string.Format ("[MyColor: A={0}, R={1}, G={2}, B={3}]", A, R, G, B); } public static MyColor FromArgb(byte alpha, byte red, byte green, byte blue) { return new MyColor().SetAlpha(alpha).SetRed(red).SetGreen(green).SetBlue(blue); } public static MyColor FromArgb(byte red, byte green, byte blue) { return MyColor.FromArgb(255, red, green, blue); } public static MyColor FromArgb(byte alpha, MyColor baseColor) { return MyColor.FromArgb(alpha, baseColor.R, baseColor.G, baseColor.B); } public static MyColor FromArgb(int argb) { return MyColor.FromArgb(argb &amp; 255, (argb &gt;&gt; 8) &amp; 255, (argb &gt;&gt; 16) &amp; 255, (argb &gt;&gt; 24) &amp; 255); } public static implicit operator Color(MyColor myColor) { return Color.FromArgb(myColor.ToArgb()); } public static implicit operator MyColor(Color color) { return MyColor.FromArgb(color.ToArgb()); } } </code></pre>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload