From 5311a6582eb8adf962f1105dbe3dd7b7ccc6e7f8 Mon Sep 17 00:00:00 2001 From: Sara <sarasdj@stud.ntnu.no> Date: Mon, 18 Mar 2024 20:02:33 +0100 Subject: [PATCH] update: test colors --- app/lib/pages/widgets/cloropleth_map.dart | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/app/lib/pages/widgets/cloropleth_map.dart b/app/lib/pages/widgets/cloropleth_map.dart index 632a504b..0fed74d1 100644 --- a/app/lib/pages/widgets/cloropleth_map.dart +++ b/app/lib/pages/widgets/cloropleth_map.dart @@ -35,6 +35,13 @@ class _ChoroplethMapState extends State<ChoroplethMap> { late MapShapeSource mapShapeSource; late final MapZoomPanBehavior _zoomPanBehavior = MapZoomPanBehavior(); List<IceThicknessModel> iceThicknessList = <IceThicknessModel>[]; + List<Color> testColors = [ // NB test color + const Color(0xff8a003b), + const Color(0xff8a4300), + const Color(0xff8a7a00), + const Color(0xff538a00), + const Color(0xff007b8a), + ]; @override void initState() { @@ -42,11 +49,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> { final Random random = Random(); for (int i = 0; i <= 120; i++) { - int red = random.nextInt(256); - int green = random.nextInt(256); - int blue = random.nextInt(256); - - Color randomColor = Color.fromRGBO(red, green, blue, 1); + int ran = random.nextInt(4); // NB test color + Color randomColor = testColors[ran]; int randomNumber = random.nextInt(21); // 0 -> 20, NB: temp test data iceThicknessList.add(IceThicknessModel(i.toString(), randomNumber, randomColor)); @@ -68,8 +72,8 @@ class _ChoroplethMapState extends State<ChoroplethMap> { shapeColorValueMapper: (int index) => iceThicknessList[index].color, ), //color: Colors.blue.shade400, // Map color - //zoomPanBehavior: _zoomPanBehavior, - //strokeColor: Colors.black, + zoomPanBehavior: _zoomPanBehavior, + strokeColor: Colors.black, // Shape selection selectedIndex: selectedIndex, onSelectionChanged: (int index) { -- GitLab