TextureScale.ColorLerpUnclamped C# (CSharp) Method

ColorLerpUnclamped() private static method

private static ColorLerpUnclamped ( Color c1, Color c2, float value ) : Color
c1 Color
c2 Color
value float
return Color
    private static Color ColorLerpUnclamped(Color c1, Color c2, float value)
    {
        return new Color(c1.r + (c2.r - c1.r) * value,
                          c1.g + (c2.g - c1.g) * value,
                          c1.b + (c2.b - c1.b) * value,
                          c1.a + (c2.a - c1.a) * value);
    }

Usage Example

Exemplo n.º 1
0
 private static void BilinearScale(int start, int end)
 {
     for (int i = start; i < end; i++)
     {
         int num  = (int)Mathf.Floor((float)i * TextureScale.ratioY);
         int num2 = num * TextureScale.w;
         int num3 = (num + 1) * TextureScale.w;
         int num4 = i * TextureScale.w2;
         for (int j = 0; j < TextureScale.w2; j++)
         {
             int   num5  = (int)Mathf.Floor((float)j * TextureScale.ratioX);
             float value = (float)j * TextureScale.ratioX - (float)num5;
             TextureScale.newColors[num4 + j] = TextureScale.ColorLerpUnclamped(TextureScale.ColorLerpUnclamped(TextureScale.texColors[num2 + num5], TextureScale.texColors[num2 + num5 + 1], value), TextureScale.ColorLerpUnclamped(TextureScale.texColors[num3 + num5], TextureScale.texColors[num3 + num5 + 1], value), (float)i * TextureScale.ratioY - (float)num);
         }
     }
 }
All Usage Examples Of TextureScale::ColorLerpUnclamped