Make a darker instance of this colour

@param scale The scale down of RGB (i.e. if you supply 0.03 the colour will be darkened by 3%)
@return The darker version of this colour
325030
public Color darker(float scale) {
        scale = 1 - scale;
		Color temp = new Color(r * scale,g * scale,b * scale,a);
		
		return temp;
	}
53347
public void setScale(float scale) {
		this.scale = scale;
		linePaint.setStrokeWidth(scale * lineStrokeWidth);
		polygonPaint.setStrokeWidth(scale * polygonStrokeWidth);
		featurePaintCache.clear();
	}
562772
private Color buildRGB255Color(final RGB255Color rColor) {
        Color color = null;
        if (rColor.opacity() >= 1.0) {
            color = Color.rgb(rColor.red(), rColor.green(), rColor.blue());
        } else {
            color = Color.rgb(rColor.red(), rColor.green(), rColor.blue(), rColor.opacity());
        }
        return color;
    }
1222972
static int darker(int color, float factor) {
    return Color.argb(Color.alpha(color), Math.max((int) (Color.red(color) * factor), 0),
        Math.max((int) (Color.green(color) * factor), 0), Math.max((int) (Color.blue(color) * factor), 0));
  }
1139197
def scale(self, vmin=0., vmax=1.):
        
        return StepColormap(
            self.colors,
            index=[vmin + (vmax-vmin)*(x-self.vmin)*1./(self.vmax-self.vmin) for x in self.index],  # noqa
            vmin=vmin,
            vmax=vmax,
            )
913181
public RgbaColor adjustHue(float degrees) {
        float[] HSL = convertToHsl();
        HSL[0] = hueCheck(HSL[0] + degrees); // ensure [0-360)
        return RgbaColor.fromHsl(HSL);
    }
1086483
private int getColor(int value) {
		if (value == 0) {
			return 0;
		}

		double scale = Math.log10(value) / Math.log10(this.topValue);
		double lengthScale = Math.min(1.0, scale) * (colors.length - 1);
		int index = 1 + (int) lengthScale;
		if (index == colors.length) {
			index--;
		}
		double partScale = lengthScale - (index - 1);

		int r = (int) (colors[index - 1][0] + partScale
				* (colors[index][0] - colors[index - 1][0]));
		int g = (int) (colors[index - 1][1] + partScale
				* (colors[index][1] - colors[index - 1][1]));
		int b = (int) (colors[index - 1][2] + partScale
				* (colors[index][2] - colors[index - 1][2]));

		r = Math.min(255, r);
		b = Math.min(255, b);
		g = Math.min(255, g);
		return (r << 16) | (g << 8) | b;
	}
538239
function bcscale(scale) {
    scale = parseInt(scale, 10);
    if (isNaN(scale)) {
        return false;
    }
    if (scale < 0) {
        return false;
    }
    libbcmath.scale = scale;
    return true;
}
830083
public static BigDecimal round(BigDecimal number, int scale) {
		return round(number, scale, RoundingMode.HALF_UP);
	}
478527
@SuppressWarnings("checkstyle:LocalVariableName")
    public static Color slightlyBrighter(final Color color) {
        int r = color.getRed();
        int g = color.getGreen();
        int b = color.getBlue();

        /*
         * From 2D group: 1. black.brighter() should return grey 2. applying brighter to blue will always return blue,
         * brighter 3. non pure color (non zero rgb) will eventually return white
         */
        final int i = (int) (1.0 / (1.0 - COLOR_SCALE_FACTOR));
        if (r == 0 && g == 0 && b == 0) {
            return new Color(i, i, i);
        }

        if (r > 0 && r < i) {
            r = i;
        }
        if (g > 0 && g < i) {
            g = i;
        }
        if (b > 0 && b < i) {
            b = i;
        }

        return new Color(Math.min((int) (r / COLOR_SCALE_FACTOR), 255), Math.min((int) (g / COLOR_SCALE_FACTOR), 255),
                Math.min((int) (b / COLOR_SCALE_FACTOR), 255));
    }
680101
def scale(self, vmin=0., vmax=1.):
        
        return LinearColormap(
            self.colors,
            index=[vmin + (vmax-vmin)*(x-self.vmin)*1./(self.vmax-self.vmin) for x in self.index],  # noqa
            vmin=vmin,
            vmax=vmax,
            )
159964
public void addScaling(double scale) {
    // invalidate inverse
    inv = null;
    // Note: last ROW is not included.
    for(int i = 0; i < dim; i++) {
      for(int j = 0; j <= dim; j++) {
        trans[i][j] = trans[i][j] * scale;
      }
    }
    // As long as relative vectors aren't used, this would also work:
    // trans[dim][dim] = trans[dim][dim] / scale;
  }
834608
@ScalarFunction
    @SqlType(ColorType.NAME)
    public static long color(@SqlType(StandardTypes.DOUBLE) double fraction, @SqlType(ColorType.NAME) long lowColor, @SqlType(ColorType.NAME) long highColor)
    {
        checkCondition(lowColor >= 0, INVALID_FUNCTION_ARGUMENT, "lowColor not a valid RGB color");
        checkCondition(highColor >= 0, INVALID_FUNCTION_ARGUMENT, "highColor not a valid RGB color");

        fraction = Math.min(1, fraction);
        fraction = Math.max(0, fraction);

        return interpolate((float) fraction, lowColor, highColor);
    }
142011
def toColor(val, colormap):
    """"""
    for i in range(0, len(colormap) - 1):
        if colormap[i + 1][0] > val:
            scale = (val - colormap[i][0]) / \
                (colormap[i + 1][0] - colormap[i][0])
            r = colormap[i][1][0] + \
                (colormap[i + 1][1][0] - colormap[i][1][0]) * scale
            g = colormap[i][1][1] + \
                (colormap[i + 1][1][1] - colormap[i][1][1]) * scale
            b = colormap[i][1][2] + \
                (colormap[i + 1][1][2] - colormap[i][1][2]) * scale
            return "#" + toHex(r) + toHex(g) + toHex(b)
    return "#" + toHex(colormap[-1][1][0]) + toHex(colormap[-1][1][1]) + toHex(colormap[-1][1][2])
804791
public static BigDecimal roundDown(BigDecimal value, int scale) {
		return round(value, scale, RoundingMode.DOWN);
	}
515885
@TargetApi(Build.VERSION_CODES.JELLY_BEAN)
	public float getShadowRadius (){
		if(Build.VERSION.SDK_INT >= Build.VERSION_CODES.JELLY_BEAN)
			return mInputView.getShadowRadius();

		return 0;
	}
1133238
public function scale($scale = 1)
    {
        if ($scale > 1) {
            $scale = 1;
        }

        $width = (int) $this->width * $scale;
        $height = (int) $this->height * $scale;

        $this->resize($width, $height);

        return $this;
    }