当前位置: 首页>>代码示例>>C#>>正文


C# Color4类代码示例

本文整理汇总了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;
 }
开发者ID:Zordonia,项目名称:AdvisIXAccel,代码行数:14,代码来源:Vertex3.cs

示例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);
 }
开发者ID:jikoriko,项目名称:OpentkEngine,代码行数:7,代码来源:Graphics.cs

示例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));
 }
开发者ID:QuantumDeveloper,项目名称:SharpDX,代码行数:14,代码来源:BlendState.cs

示例4: BasicVec4

 public BasicVec4(Color4 v)
 {
     x = v.R;
     y = v.G;
     z = v.B;
     w = v.A;
 }
开发者ID:TGEnigma,项目名称:Amicitia,代码行数:7,代码来源:ModelViewer.cs

示例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"));
 }
开发者ID:qwook,项目名称:hungry,代码行数:8,代码来源:BooleanIndicator.cs

示例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;
 }
开发者ID:modulexcite,项目名称:rasterizr,代码行数:7,代码来源:Texture3D.cs

示例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;
 }
开发者ID:lvarvel,项目名称:aura,代码行数:7,代码来源:Material.cs

示例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);
 }
开发者ID:QuantumDeveloper,项目名称:SharpDX,代码行数:14,代码来源:Palette.cs

示例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;
 }
开发者ID:aokomoriuta,项目名称:StudiesOfOpenTK,代码行数:13,代码来源:Cube.cs

示例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;
 }
开发者ID:aokomoriuta,项目名称:StudiesOfOpenTK,代码行数:12,代码来源:Cube.cs

示例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);
 }
开发者ID:dzamkov,项目名称:Hailstone,代码行数:10,代码来源:Render.cs

示例12: EnvLight

		/// <summary>
		/// Creates instance of EnvLight
		/// </summary>
		public EnvLight ()
		{
			Position	=	Vector3.Zero;
			RadiusInner	=	0;
			RadiusOuter	=	1;
			Intensity	=	new Color4(1,1,1,0);
		}
开发者ID:demiurghg,项目名称:FusionEngine,代码行数:10,代码来源:EnvLight.cs

示例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
 }
开发者ID:gitter-badger,项目名称:Grasshopper,代码行数:7,代码来源:Program.cs

示例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);
        }
开发者ID:Robmaister,项目名称:RoversSpirit,代码行数:37,代码来源:ColorBox.cs

示例15: Pixel

 public Pixel(Color4 color)
     : this()
 {
     RedF = color.R;
     GreenF = color.G;
     BlueF = color.B;
 }
开发者ID:NightmareX1337,项目名称:ULF,代码行数:7,代码来源:GraphicsManager.cs


注:本文中的Color4类示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。