示例#1
0
 public ColorRGBA(ColorRGBAF c)
 {
     Red   = c.Red;
     Green = c.Green;
     Blue  = c.Blue;
     Alpha = c.Alpha;
 }
示例#2
0
        /// <summary>
        /// Scalar multiply operator.
        /// </summary>
        /// <param name="a">
        /// A <see cref="ColorRGBAF"/> to be casted.
        /// </param>
        /// <param name="scalar">
        /// A <see cref="Single"/> that specify the right operand.
        /// </param>
        /// <returns>
        /// A <see cref="ColorRGBAF"/> that equals to the multiplication of <paramref name="a"/> with <paramref name="scalar"/>.
        /// </returns>
        public static ColorRGBAF operator*(ColorRGBAF a, float scalar)
        {
            ColorRGBAF v = new ColorRGBAF();

            v.r = (float)(a.r * scalar);
            v.g = (float)(a.g * scalar);
            v.b = (float)(a.b * scalar);
            v.a = (float)(a.a * scalar);

            return(v);
        }
 /// <summary>
 /// Set uniform state variable (variant type variable)
 /// </summary>
 /// <param name="ctx">
 /// A <see cref="GraphicsContext"/> used for operations.
 /// </param>
 /// <param name="uniformName">
 /// A <see cref="String"/> that specify the variable name in the shader source.
 /// </param>
 /// <param name="v">
 /// A <see cref="ColorRGBAF"/> holding the uniform variabile data.
 /// </param>
 public void SetVariantUniform(GraphicsContext ctx, string uniformName, ColorRGBAF v)
 {
     SetVariantUniform(ctx, uniformName, v.Red, v.Green, v.Blue, v.Alpha);
 }
示例#4
0
 /// <summary>
 /// Set the color used for clearing this GraphicsSurface color buffer.
 /// </summary>
 /// <param name="color">
 /// A <see cref="ColorRGBAF"/> which holds the RGBA values used for clearing
 /// this GraphicsSurface color buffer.
 /// </param>
 public void SetClearColor(ColorRGBAF color)
 {
     // Store clear color
     mClearColor = color;
 }