From 18e3f4770c1fa9c7f9244c8b8e0c2c0dc0365db0 Mon Sep 17 00:00:00 2001 From: TechnicJelle <22576047+TechnicJelle@users.noreply.github.com> Date: Thu, 19 Dec 2024 10:47:57 +0100 Subject: [PATCH] feat(example): improve appearance of dark mode filter (#2003) --- lib/src/layer/tile_layer/tile_builder.dart | 50 +++++----------------- 1 file changed, 10 insertions(+), 40 deletions(-) diff --git a/lib/src/layer/tile_layer/tile_builder.dart b/lib/src/layer/tile_layer/tile_builder.dart index 2854748cd..562a613c8 100644 --- a/lib/src/layer/tile_layer/tile_builder.dart +++ b/lib/src/layer/tile_layer/tile_builder.dart @@ -12,26 +12,11 @@ Widget darkModeTilesContainerBuilder( ) { return ColorFiltered( colorFilter: const ColorFilter.matrix([ - -1, - 0, - 0, - 0, - 255, - 0, - -1, - 0, - 0, - 255, - 0, - 0, - -1, - 0, - 255, - 0, - 0, - 0, - 1, - 0, + //Colors get Inverted and then Hue Rotated by 180 degrees + 0.5740000009536743, -1.4299999475479126, -0.14399999380111694, 0, 255, //R + -0.4259999990463257, -0.429999977350235, -0.14399999380111694, 0, 255, //G + -0.4259999990463257, -1.4299999475479126, 0.8559999465942383, 0, 255, //B + 0, 0, 0, 1, 0, //A ]), child: tilesContainer, ); @@ -46,26 +31,11 @@ Widget darkModeTileBuilder( ) { return ColorFiltered( colorFilter: const ColorFilter.matrix([ - -1, - 0, - 0, - 0, - 255, - 0, - -1, - 0, - 0, - 255, - 0, - 0, - -1, - 0, - 255, - 0, - 0, - 0, - 1, - 0, + //Colors get Inverted and then Hue Rotated by 180 degrees + 0.5740000009536743, -1.4299999475479126, -0.14399999380111694, 0, 255, //R + -0.4259999990463257, -0.429999977350235, -0.14399999380111694, 0, 255, //G + -0.4259999990463257, -1.4299999475479126, 0.8559999465942383, 0, 255, //B + 0, 0, 0, 1, 0, //A ]), child: tileWidget, );