Android map marker color?

kucluk picture kucluk · Sep 29, 2013 · Viewed 42.2k times · Source

What color is available to make a marker on Android map?
How many colors are there and how to write the code of color?

Answer

S.Thiongane picture S.Thiongane · Oct 9, 2015

Here is a method I am using to generate dynamic Hue colors for markers based on given String color.

May be useful for someone :)

Marker melbourne = mMap.addMarker(new MarkerOptions().position(MELBOURNE)
.icon(getMarkerIcon("#ff2299")));

// method definition
public BitmapDescriptor getMarkerIcon(String color) {
    float[] hsv = new float[3];
    Color.colorToHSV(Color.parseColor(color), hsv);
    return BitmapDescriptorFactory.defaultMarker(hsv[0]);
}