public LED3DObject(RGB color, TimeSpan lifeTime) { this.color = color; this.bornAt = DateTime.Now; this.lifeTime = lifeTime; }
public LED3DObject(RGB color) : this(color, TimeSpan.Zero) { }
public LED3DDot(double x, double y, double z, RGB color) : this(x, y, z, color, TimeSpan.Zero) { }
public Dot(double x, double y, RGB rgb) : this(x, y, 0, rgb) { }
// HSVをRGBに変換 public static RGB HSV2RGB(int H, int S, int V, int A) { if (H > 360) { H = 360; } if (S > 360) { S = 360; } if (V > 360) { V = 360; } if (H == 360) { H = 0; } int Hi = (int)Math.Floor((double)H / 60) % 6; float f = ((float)H / 60) - Hi; float p = ((float)V / 255) * (1 - ((float)S / 255)); float q = ((float)V / 255) * (1 - f * ((float)S / 255)); float t = ((float)V / 255) * (1 - (1 - f) * ((float)S / 255)); p *= 255; q *= 255; t *= 255; RGB rgb = null; switch (Hi) { case 0: rgb = new RGB(V, (int)t, (int)p, A); break; case 1: rgb = new RGB((int)q, V, (int)p, A); break; case 2: rgb = new RGB((int)p, V, (int)t, A); break; case 3: rgb = new RGB((int)p, (int)q, V, A); break; case 4: rgb = new RGB((int)t, (int)p, V, A); break; case 5: rgb = new RGB(V, (int)p, (int)q, A); break; } return(rgb); }
public LED3DBall(double x, double y, double z, double w, double h, RGB color) : this(x, y, z, w, h, color, TimeSpan.Zero) { }