diff options
Diffstat (limited to 'platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs')
-rw-r--r-- | platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs index 2fb51f4a47..27bb66aa08 100644 --- a/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs +++ b/platform/android/MapboxGLAndroidSDK/src/main/java/com/mapbox/mapboxsdk/style/layers/property_factory.java.ejs @@ -9,9 +9,7 @@ package com.mapbox.mapboxsdk.style.layers; import android.support.annotation.ColorInt; import com.mapbox.mapboxsdk.style.expressions.Expression; - -import java.text.DecimalFormat; -import java.util.Locale; +import com.mapbox.mapboxsdk.utils.ColorUtils; /** * Constructs paint/layout properties for Layers @@ -94,11 +92,11 @@ public class PropertyFactory { * * @param color Android color int * @return String rgba color + * @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaString(int)} instead */ + @Deprecated public static String colorToRgbaString(@ColorInt int color) { - String alpha = new DecimalFormat("#.###").format(((float)((color >> 24) & 0xFF)) / 255.0f); - return String.format(Locale.US, "rgba(%d, %d, %d, %s)", - (color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF, alpha); + return ColorUtils.colorToRgbaString(color); } /** @@ -109,8 +107,10 @@ public class PropertyFactory { * * @param color Android color int * @return int rgba array + * @deprecated use {@link com.mapbox.mapboxsdk.utils.ColorUtils#colorToRgbaArray(int)} instead */ + @Deprecated public static float[] colorToRgbaArray(@ColorInt int color) { - return new float[] {(color >> 16) & 0xFF, (color >> 8) & 0xFF, color & 0xFF, ((color >> 24) & 0xFF) / 255.0f}; + return ColorUtils.colorToRgbaArray(color); } }
\ No newline at end of file |