本文整理汇总了C#中Color4类的典型用法代码示例。如果您正苦于以下问题:C# Color4类的具体用法?C# Color4怎么用?C# Color4使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Color4类属于命名空间,在下文中一共展示了Color4类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Vertex3
/// <summary>
/// Constructor for the Vertex3 class, takes float variables for the x y and z positions, as well as a color.
/// </summary>
/// <param name="x">The float representation of the Vertex3's x position.</param>
/// <param name="y">The float representation of the Vertex3's y position.</param>
/// <param name="z">The float representation of the Vertex3's z position.</param>
/// <param name="color">The color of this particular Vertex3.</param>
public Vertex3(float x, float y, float z, Color4 color)
{
this.x = x;
this.y = y;
this.z = z;
this.myColor = color;
}
示例2: DrawRect
public static void DrawRect(float x, float y, float z, float width, float height, int lineWidth, Color4 color)
{
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Line);
GL.LineWidth(lineWidth);
FillRect(x, y, z, width, height, color);
GL.PolygonMode(MaterialFace.FrontAndBack, PolygonMode.Fill);
}
示例3: BlendState
/// <summary>
/// Initializes a new instance of the <see cref="BlendState" /> class.
/// </summary>
/// <param name="device">The device local.</param>
/// <param name="description">The description.</param>
/// <param name="blendFactor">The blend factor.</param>
/// <param name="mask">The mask.</param>
private BlendState(GraphicsDevice device, BlendStateDescription description, Color4 blendFactor, int mask) : base(device)
{
Description = description;
BlendFactor = blendFactor;
MultiSampleMask = mask;
Initialize(new Direct3D11.BlendState(GraphicsDevice, Description));
}
示例4: BasicVec4
public BasicVec4(Color4 v)
{
x = v.R;
y = v.G;
z = v.B;
w = v.A;
}
示例5: BooleanIndicator
// Main constructor:
public BooleanIndicator(RenderSet render_set, double x, double y)
: base(render_set, x, y, 1.0, 1.0, null, Texture.Get("sprite_indicator"))
{
State = false;
_Color = new Color4(Color.SkyBlue);
_NextLayer = new LayeredSprite(render_set, x, y, 1.0, 1.0, null, Texture.Get ("sprite_indicator_gloss"));
}
示例6: GetData
public override Color4[] GetData(int subresource)
{
var data = _subresources[subresource].Data;
var result = new Color4[data.Length];
Utilities.Copy(data, result);
return result;
}
示例7: Material
public Material()
{
Ambient = new Color4(1, 1, 1);
Diffuse = new Color4(1, 1, 1);
Specular = new Color4(1, 1, 1);
SpecularExponent = 0.1f;
}
示例8: Initialize
/// <summary>
/// Initializes with the specified colors.
/// </summary>
/// <param name="colors">The colors.</param>
/// <msdn-id>ee719750</msdn-id>
/// <unmanaged>HRESULT IWICPalette::InitializeCustom([In, Buffer] void* pColors,[In] unsigned int cCount)</unmanaged>
/// <unmanaged-short>IWICPalette::InitializeCustom</unmanaged-short>
public void Initialize(Color4[] colors)
{
var rawColors = new Color[colors.Length];
for (int i = 0; i < rawColors.Length; i++)
rawColors[i] = (Color)colors[i];
Initialize(rawColors);
}
示例9: Cube
/// <summary>
/// 立方体を作成する
/// </summary>
/// <param name="_position">中心座標</param>
/// <param name="_size">1辺の長さ</param>
/// <param name="_color">表示色</param>
public Cube(Vector3 _position, float _size, Color4 _color)
{
// 各パラメーターを設定
this.position = _position;
this.size = _size;
this.color = _color;
}
示例10: Cube
/// <summary>
/// 立方体を作成する
/// </summary>
/// <param name="_size">1辺の長さ</param>
/// <param name="_color">表示色</param>
public Cube(float _size, Color4 _color)
{
// 各パラメーターを設定
this.position = new Vector3();
this.size = _size;
this.color = _color;
}
示例11: Draw
/// <summary>
/// Draws this shape using the given scale and offset.
/// </summary>
public void Draw(Render Render, Color4 Color, Vector Offset, double Scale)
{
Render.Vertex(Destination.TopLeft * Scale + Offset, Source.TopLeft, Color);
Render.Vertex(Destination.BottomLeft * Scale + Offset, Source.BottomLeft, Color);
Render.Vertex(Destination.BottomRight * Scale + Offset, Source.BottomRight, Color);
Render.Vertex(Destination.TopRight * Scale + Offset, Source.TopRight, Color);
}
示例12: EnvLight
/// <summary>
/// Creates instance of EnvLight
/// </summary>
public EnvLight ()
{
Position = Vector3.Zero;
RadiusInner = 0;
RadiusOuter = 1;
Intensity = new Color4(1,1,1,0);
}
示例13: Vertex
public Vertex(Vector4 position, Color4 color, Vector2 textureCoordinate)
{
Position = position;
Color = color;
TextureCoordinate = textureCoordinate;
_pad0 = Vector2.Zero; // important to align the vertex to a 16 byte boundary
}
示例14: ColorBox
/// <summary>
/// position is top left of box.
/// </summary>
/// <param name="position"></param>
/// <param name="size"></param>
/// <param name="color"></param>
public ColorBox(Vector2 position, Vector2 size, Color4 color)
{
this.position = position;
this.size = size;
model = Matrix4.CreateTranslation(position.X, position.Y, 0);
Color = color;
float[] vertices = new float[]
{
0, 0,
0, size.Y,
size.X, 0,
size.X, size.Y
};
uint[] indices = new uint[]
{
0, 1, 2, 3
};
VBO vert = new VBO(), ind = new VBO();
vert.SetData(ref vertices, BufferUsageHint.StaticDraw);
ind.SetData(ref indices, BufferUsageHint.StaticDraw);
bufSet = new BufferSet();
bufSet.VertexBuffer = vert;
bufSet.IndexBuffer = ind;
bufSet.VertexSize = 2;
bufSet.DrawMode = BeginMode.TriangleStrip;
bufSet.SetDrawState(DrawStates.Vertex);
}
示例15: Pixel
public Pixel(Color4 color)
: this()
{
RedF = color.R;
GreenF = color.G;
BlueF = color.B;
}