Lines Matching defs:percent
113 float percent = (currentPos - mPositions[prevPos]) /
116 mGradient[i] = computeColor(mColors[prevPos], mColors[nextPos], percent);
192 * Returns the color between c1, and c2, based on the percent of the distance
195 private int computeColor(int c1, int c2, float percent) {
196 int a = computeChannel((c1 >> 24) & 0xFF, (c2 >> 24) & 0xFF, percent);
197 int r = computeChannel((c1 >> 16) & 0xFF, (c2 >> 16) & 0xFF, percent);
198 int g = computeChannel((c1 >> 8) & 0xFF, (c2 >> 8) & 0xFF, percent);
199 int b = computeChannel((c1 ) & 0xFF, (c2 ) & 0xFF, percent);
204 * Returns the channel value between 2 values based on the percent of the distance between
207 private int computeChannel(int c1, int c2, float percent) {
208 return c1 + (int)((percent * (c2-c1)) + .5);