What color is available to make a marker on Android map?
How many colors are there and how to write the code of color?
To edit the marker color, click or tap on the marker icon. When you do that, you can change both the color of the marker and its style. Go for the color or style you want to change and then click OK to see the effect. Click on the button labeled Done to save your new marker color settings.
For adding a custom marker to Google Maps navigate to the app > res > drawable > Right-Click on it > New > Vector Assets and select the icon which we have to show on your Map. You can change the color according to our requirements. After creating this icon now we will move towards adding this marker to our Map.
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]); }
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With