I am trying to add a custom colored marker to a map. I found this answer, which states that I need to feed a BitmapDescriptorFactory
with a HUE color and give that to the .icon()
method of the MarkerOptions
, but when I am using a converter to get the HUE value for my color (#678E00), it gives me 3 values, (76,100,27.8), but I can only provide 1 number to the BitmapDescriptorFactory
. Do you know how I could do this?
Asked
Active
Viewed 123 times
0

Analizer
- 1,594
- 16
- 30
1 Answers
0
The HSL (Hue, Saturation, Lightness) representation of your Hex color (#678E00) is 76, 100, 27.8.
This means that the Hue of your color is 76 which is the value that you need to feed to the defaultMarker
function:
.defaultMarker(76)
Take into account that you can only set the Hue of the marker and the Saturation and Lightness won't be modified so your color will be different than the original #678E00

antonio
- 18,044
- 4
- 45
- 61
-
Thanks for the response! Yes, this was my issue, I used 76, but that`s not the color I needed. So is there no way to represent any color in the BitmapDescriptorFactory? – Analizer May 22 '18 at 09:24
-
Using the `BitmapDescriptorFactory` you can only shift the hue, and as you can't touch the saturation and lightness you won't be able to get your desired color. You will need to use a custom marker icon – antonio May 22 '18 at 19:54