Home | History | Annotate | Download | only in graphics

Lines Matching refs:percent

114                     float percent = (currentPos - mPositions[prevPos]) /
117 mGradient[i] = computeColor(mColors[prevPos], mColors[nextPos], percent);
193 * Returns the color between c1, and c2, based on the percent of the distance
196 private int computeColor(int c1, int c2, float percent) {
197 int a = computeChannel((c1 >> 24) & 0xFF, (c2 >> 24) & 0xFF, percent);
198 int r = computeChannel((c1 >> 16) & 0xFF, (c2 >> 16) & 0xFF, percent);
199 int g = computeChannel((c1 >> 8) & 0xFF, (c2 >> 8) & 0xFF, percent);
200 int b = computeChannel((c1 ) & 0xFF, (c2 ) & 0xFF, percent);
205 * Returns the channel value between 2 values based on the percent of the distance between
208 private int computeChannel(int c1, int c2, float percent) {
209 return c1 + (int)((percent * (c2-c1)) + .5);