Пример #1
0
 /// <since>5.0</since>
 public Color4f(Color4f color)
 {
     m_r = color.R;
     m_g = color.G;
     m_b = color.B;
     m_a = color.A;
 }
Пример #2
0
        /// <since>5.0</since>
        public Color4f BlendTo(float t, Color4f col)
        {
            float r = m_r + (t * (col.m_r - m_r));
            float g = m_g + (t * (col.m_g - m_g));
            float b = m_b + (t * (col.m_b - m_b));
            float a = m_a + (t * (col.m_a - m_a));

            return(new Color4f(r, g, b, a));
        }
Пример #3
0
        /// <since>6.0</since>
        public static Color4f ApplyGamma(Color4f col, float gamma)
        {
            if (Math.Abs(gamma - 1.0f) > float.Epsilon)
            {
                float r = (float)Math.Pow(col.m_r, gamma);
                float g = (float)Math.Pow(col.m_g, gamma);
                float b = (float)Math.Pow(col.m_b, gamma);

                return(new Color4f(r, g, b, col.m_a));
            }

            return(col);
        }
Пример #4
0
 /// <since>5.11</since>
 public static Color4f FromArgb(float a, Color4f color)
 {
     return(new Color4f(color.R, color.G, color.B, a));
 }