Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Custom colors

Description

Custom styles implementation!

Screenshots

Screenshot_1678641263

Technical details

  • Layers in styles have metadata so that microG knows what layers are associated with what group of layers in GMS
  • microG traverses layers selected by the styler and applies the style operation to each color that it finds

Limitations:

  • Icons cannot be recolored (POI icons, road icons)
  • POIs cannot be targeted with high granularity (poi.attraction, poi.business etc.) because they are consolidated in one layer

Tests

Test arbitrary custom styles like this:

--- a/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/Styles.kt
+++ b/play-services-maps-core-mapbox/src/main/kotlin/org/microg/gms/maps/mapbox/Styles.kt
@@ -35,7 +35,19 @@ fun getStyle(context: MapContext, storedMapType: Int, styleOptions: MapStyleOpti
         ).bufferedReader().readText()
     )
 
-    styleOptions?.apply(styleJson)
+    (styleOptions?: MapStyleOptions("""
+[
+    {
+            "stylers": [
+            {
+                "invert_lightness": true
+            }
+        ]
+
+    }
+]
+    """.trimIndent()))
+    .apply(styleJson)
 
     return Style.Builder().fromJson(styleJson.toString())
 }

Or test Uber's style in the Uber app.

Issues

10 commandments of code reviews

👪 https://gitlab.e.foundation/internal/wiki/-/wikis/development/code-review

Edited by Fynn Godau

Merge request reports

Loading