return random hex color
@method
@memberof Kinetic.Util.prototype
556502
function() {
            var randColor = (Math.random() * 0xFFFFFF << 0).toString(16);
            while (randColor.length < 6) {
                randColor = ZERO + randColor;
            }
            return HASH + randColor;
        }
329942
function (hexColor) {
            // TODO : Memoize this function by caching its input

            var match;
            if ((match = hex8Rx.exec(hexColor))) {
                // #AARRGGBB
                return this.setColor(
                    parseInt(match[1], 16),
                    parseInt(match[2], 16),
                    parseInt(match[3], 16),
                    (me.Math.clamp(parseInt(match[4], 16), 0, 255) / 255.0).toFixed(1)
                );
            }

            if ((match = hex6Rx.exec(hexColor))) {
                // #RRGGBB
                return this.setColor(
                    parseInt(match[1], 16),
                    parseInt(match[2], 16),
                    parseInt(match[3], 16)
                );
            }

            if ((match = hex4Rx.exec(hexColor))) {
                // #ARGB
                return this.setColor(
                    parseInt(match[1] + match[1], 16),
                    parseInt(match[2] + match[2], 16),
                    parseInt(match[3] + match[3], 16),
                    (me.Math.clamp(parseInt(match[4] + match[4], 16), 0, 255) / 255.0).toFixed(1)
                );
            }

            if ((match = hex3Rx.exec(hexColor))) {
                // #RGB
                return this.setColor(
                    parseInt(match[1] + match[1], 16),
                    parseInt(match[2] + match[2], 16),
                    parseInt(match[3] + match[3], 16)
                );
            }

            throw new Error(
                "invalid parameter: " + hexColor
            );
        }
861396
public static function randomColor()
    {
        mt_srand((double)microtime() * 1000000);
        $color = '';
        while (strlen($color) < 6) {
            $color .= sprintf("%02X", mt_rand(0, 255));
        }
        return '#' . $color;
    }
946462
private Color randomColor() {
        Random r = new Random();
        int red = r.nextInt(150);
        int green = r.nextInt(150);
        int blue = r.nextInt(150);
        return new Color(red, green, blue);
    }
425490
function (hex) {
                var shortformRegex = /^#?([a-f\d])([a-f\d])([a-f\d])$/i,
                    longformRegex = /^#?([a-f\d]{2})([a-f\d]{2})([a-f\d]{2})$/i,
                    rgbParts;

                hex = hex.replace(shortformRegex, function (m, r, g, b) {
                    return r + r + g + g + b + b;
                });

                rgbParts = longformRegex.exec(hex);

                return rgbParts ? [ parseInt(rgbParts[1], 16), parseInt(rgbParts[2], 16), parseInt(rgbParts[3], 16) ] : [ 0, 0, 0 ];
            }
1079036
function formatBufferColored(err, options) {
    // istanbul ignore else
    if (!hex) {
        return err.buffer.toString('hex');
    }

    options = options || {};
    var opts = options.hexerOptions ? Object.create(options.hexerOptions) : {};
    if (opts.colored === undefined) {
        opts.colored = true;
    }
    var highlight = errorHighlighter(err, options);
    opts.decorateHexen = highlight;
    opts.decorateHuman = highlight;
    return hex(err.buffer, opts);
}
735124
def color_hex(self):
        """"""
        def clamp(x):
            return max(0, min(int(x), 255))

        r, g, b = np.trunc(self.color_rgb * 255)
        return "#{0:02x}{1:02x}{2:02x}".format(clamp(r), clamp(g), clamp(b))
588904
public function randomColor()
    {
        mt_srand((double)microtime() * 1000000);
        $c = '';
        while (strlen($c) < 6) {
            $c .= sprintf("%02X", mt_rand(0, 255));
        }
        return '#' . $c;
    }
368224
private static String getHexSingle(String hex, int colorIndex) {
		validateHex(hex);

		if (hex.startsWith("#")) {
			hex = hex.substring(1);
		}

		int colorCharacters = 1;
		int numColors = hex.length();
		if (numColors > 4) {
			colorCharacters++;
			numColors /= 2;
		}

		String color = null;
		if (colorIndex >= 0 || numColors > 3) {
			if (numColors > 3) {
				colorIndex++;
			}
			int startIndex = colorIndex;
			if (colorCharacters > 1) {
				startIndex *= 2;
			}
			color = hex.substring(startIndex, startIndex + colorCharacters);
			color = expandShorthandHexSingle(color);
		}

		return color;
	}
1262138
function(opt_randFunc) {
    var randFunc = opt_randFunc || randInt;
    var strong = randFunc(3);
    var colors = [];
    for (var ii = 0; ii < 3; ++ii) {
      colors.push(randFunc(128) + (ii === strong ? 128 : 64));
    }
    return "rgb(" + colors.join(",") + ")";
  }
512891
def hex_color(value):
    '''
    '''
    r = ((value >> (8 * 2)) & 255) / 255.0
    g = ((value >> (8 * 1)) & 255) / 255.0
    b = ((value >> (8 * 0)) & 255) / 255.0
    return (r, g, b)
1070939
def random_hex(length):
    """"""
    return escape.to_unicode(binascii.hexlify(os.urandom(length))[length:])
295913
private Color mutateColour(Color colour, Random rng)
    {
        if (mutationProbability.nextValue().nextEvent(rng))
        {
            return new Color(mutateColourComponent(colour.getRed()),
                             mutateColourComponent(colour.getGreen()),
                             mutateColourComponent(colour.getBlue()),
                             mutateColourComponent(colour.getAlpha()));
        }
        else
        {
            return colour;
        }
    }
892120
function getColorObj(text) {
  const hashedText = hash(text);
  const colorIndex = hashedText % materialColors.length;

  return materialColors[colorIndex];
}
141981
function( t ){
            var idx;
            if( this.colors.size() > 2 ){
                idx = Math.floor( this.map.getClippedValueFor(t) + 0.5 );
            } else {
                idx = t >= this.map.getInputMedian() ? 1 : 0;
            }
            return this.colors.get(idx);
        }
5794
function _hexToDecColor($hex)
    {
        $length = strlen($hex);
        $color['red'] = hexdec(substr($hex, $length - 6, 2));
        $color['green'] = hexdec(substr($hex, $length - 4, 2));
        $color['blue'] = hexdec(substr($hex, $length - 2, 2));
        return $color;
    }
547047
def random(self):
        
        return '#' + random.randrange(256).encode('hex') + \
               random.randrange(256).encode('hex') + random.randrange(256).encode('hex')