MCPcopy Create free account
hub / github.com/JetBrains/skija / makeLerp

Method makeLerp

shared/java/Color.java:5–10  ·  view source on GitHub ↗
(int c1, int c2, float weight)

Source from the content-addressed store, hash-verified

3public class Color {
4 // TODO premultiply, alpha
5 public static int makeLerp(int c1, int c2, float weight) {
6 int r = (int) (getR(c1) * weight + getR(c2) * (1 - weight));
7 int g = (int) (getG(c1) * weight + getG(c2) * (1 - weight));
8 int b = (int) (getB(c1) * weight + getB(c2) * (1 - weight));
9 return makeRGB(r, g, b);
10 }
11
12 public static int makeARGB(int a, int r, int g, int b) {
13 assert 0 <= a && a <= 255 : "Alpha is out of 0..255 range: " + a;

Callers 2

drawFractalMethod · 0.95
drawMethod · 0.95

Calls 4

getRMethod · 0.95
getGMethod · 0.95
getBMethod · 0.95
makeRGBMethod · 0.95

Tested by

no test coverage detected