LCOV - code coverage report
Current view: top level - lib/themes - cwtch.dart (source / functions) Hit Total Coverage
Test: lcov.info Lines: 36 119 30.3 %
Date: 2024-04-05 23:55:39 Functions: 0 0 -

          Line data    Source code
       1             : import 'dart:ui';
       2             : import 'dart:core';
       3             : 
       4             : import 'package:flutter/material.dart';
       5             : 
       6             : import 'opaque.dart';
       7             : 
       8             : // hard coded fallback theme
       9             : //    - Used if needed briefly at startup before themes loaded
      10             : //    - Used as basis for other themes if they don't override all the colors
      11             : 
      12             : const cwtch_theme = "cwtch";
      13             : 
      14          12 : final Color darkGreyPurple = Color(0xFF281831);
      15          12 : final Color deepPurple = Color(0xFF422850);
      16          12 : final Color mauvePurple = Color(0xFF8E64A5);
      17          12 : final Color whiteishPurple = Color(0xFFE3DFE4);
      18           0 : final Color lightGrey = Color(0xFF9E9E9E);
      19           0 : final Color softGreen = Color(0xFFA0FFB0);
      20           0 : final Color softRed = Color(0xFFFFA0B0);
      21             : 
      22          12 : final Color whitePurple = Color(0xFFFFFDFF);
      23           0 : final Color softPurple = Color(0xFFFDF3FC);
      24          12 : final Color purple = Color(0xFFDFB9DE);
      25           0 : final Color brightPurple = Color(0xFFD1B0E0); // not in new: portrait badge color
      26           0 : final Color darkPurple = Color(0xFF350052);
      27           0 : final Color greyPurple = Color(0xFF775F84); // not in new: portrait borders
      28           0 : final Color pink = Color(0xFFE85DA1); // not in new: active button color
      29          12 : final Color hotPink = Color(0xFFD20070); // Color(0xFFD01972);
      30           0 : final Color softGrey = Color(0xFFB3B6B3); // not in new theme: blocked
      31             : 
      32           0 : OpaqueThemeType GetCwtchTheme(String mode) {
      33           0 :   if (mode == mode_dark) {
      34           0 :     return CwtchDark();
      35             :   } else {
      36           0 :     return CwtchLight();
      37             :   }
      38             : }
      39             : 
      40             : class CwtchDark extends OpaqueThemeType {
      41          12 :   static final Color background = darkGreyPurple;
      42          12 :   static final Color header = darkGreyPurple;
      43           0 :   static final Color userBubble = mauvePurple;
      44           0 :   static final Color peerBubble = deepPurple;
      45          12 :   static final Color font = whiteishPurple;
      46          12 :   static final Color settings = whiteishPurple;
      47          12 :   static final Color accent = hotPink;
      48             : 
      49           0 :   get theme => cwtch_theme;
      50           4 :   get mode => mode_dark;
      51             : 
      52           8 :   get backgroundHilightElementColor => deepPurple;
      53           8 :   get backgroundMainColor => background; // darkGreyPurple;
      54           8 :   get backgroundPaneColor => header; //darkGreyPurple;
      55           8 :   get defaultButtonColor => accent; //hotPink;
      56           0 :   get defaultButtonDisabledColor => lightGrey;
      57           0 :   get defaultButtonDisabledTextColor => darkGreyPurple;
      58           8 :   get defaultButtonTextColor => whiteishPurple;
      59           8 :   get dropShadowColor => mauvePurple;
      60           8 :   get hilightElementColor => purple;
      61           8 :   get mainTextColor => font; //whiteishPurple;
      62           0 :   get messageFromMeBackgroundColor => userBubble; //  mauvePurple;
      63           0 :   get messageFromMeTextColor => font; //whiteishPurple;
      64           0 :   get messageFromOtherBackgroundColor => peerBubble; //deepPurple;
      65           0 :   get messageFromOtherTextColor => font; //whiteishPurple;
      66           0 :   get messageSelectionColor => accent;
      67           2 :   get portraitBackgroundColor => deepPurple;
      68           0 :   get portraitBlockedBorderColor => lightGrey;
      69           0 :   get portraitBlockedTextColor => lightGrey;
      70           0 :   get portraitContactBadgeColor => hotPink;
      71           0 :   get portraitContactBadgeTextColor => whiteishPurple;
      72           2 :   get portraitOfflineBorderColor => purple;
      73           0 :   get portraitOnlineBorderColor => whiteishPurple;
      74           0 :   get portraitOnlineAwayColor => Color(0xFFFFF59D);
      75           0 :   get portraitOnlineBusyColor => Color(0xFFEF9A9A);
      76           2 :   get portraitProfileBadgeColor => hotPink;
      77           2 :   get portraitProfileBadgeTextColor => whiteishPurple;
      78           8 :   get scrollbarDefaultColor => purple;
      79           0 :   get sendHintTextColor => mauvePurple;
      80           0 :   get chatReactionIconColor => mauvePurple;
      81           4 :   get textfieldBackgroundColor => deepPurple;
      82           4 :   get textfieldBorderColor => deepPurple;
      83           4 :   get textfieldErrorColor => hotPink;
      84           8 :   get textfieldHintColor => mainTextColor;
      85           8 :   get textfieldSelectionColor => accent;
      86           8 :   get toolbarIconColor => settings; //whiteishPurple;
      87           8 :   get topbarColor => header; //darkGreyPurple;
      88           4 :   get menuBackgroundColor => accent;
      89           0 :   get menuTextColor => darkGreyPurple;
      90           8 :   get snackbarBackgroundColor => accent;
      91           8 :   get snackbarTextColor => whitePurple;
      92           0 :   get chatImageColor => purple;
      93             : }
      94             : 
      95             : class CwtchLight extends OpaqueThemeType {
      96           0 :   static final Color background = whitePurple;
      97           0 :   static final Color header = softPurple;
      98           0 :   static final Color userBubble = purple;
      99           0 :   static final Color peerBubble = softPurple;
     100           0 :   static final Color font = darkPurple;
     101           0 :   static final Color settings = darkPurple;
     102           0 :   static final Color accent = hotPink;
     103             : 
     104           0 :   get theme => cwtch_theme;
     105           0 :   get mode => mode_light;
     106             : 
     107           0 :   get backgroundHilightElementColor => softPurple;
     108           0 :   get backgroundMainColor => background; //whitePurple;
     109           0 :   get backgroundPaneColor => background; //whitePurple;
     110           0 :   get defaultButtonColor => accent; // hotPink;
     111           0 :   get defaultButtonDisabledColor => softGrey;
     112           0 :   get defaultButtonTextColor => whitePurple; // ?
     113           0 :   get dropShadowColor => purple;
     114           0 :   get hilightElementColor => purple;
     115           0 :   get mainTextColor => settings;
     116           0 :   get messageFromMeBackgroundColor => userBubble; //brightPurple;
     117           0 :   get messageFromMeTextColor => font; //mainTextColor;
     118           0 :   get messageFromOtherBackgroundColor => peerBubble; //purple;
     119           0 :   get messageFromOtherTextColor => font; //darkPurple;
     120           0 :   get messageSelectionColor => accent;
     121           0 :   get portraitBackgroundColor => softPurple;
     122           0 :   get portraitBlockedBorderColor => softGrey;
     123           0 :   get portraitBlockedTextColor => softGrey;
     124           0 :   get portraitContactBadgeColor => accent;
     125           0 :   get portraitContactBadgeTextColor => whitePurple;
     126           0 :   get portraitOfflineBorderColor => greyPurple;
     127           0 :   get portraitOnlineBorderColor => greyPurple;
     128           0 :   get portraitOnlineAwayColor => Color(0xFFFFF59D);
     129           0 :   get portraitOnlineBusyColor => Color(0xFFEF9A9A);
     130           0 :   get portraitProfileBadgeColor => accent;
     131           0 :   get portraitProfileBadgeTextColor => whitePurple;
     132           0 :   get scrollbarDefaultColor => accent;
     133           0 :   get sendHintTextColor => purple;
     134           0 :   get chatReactionIconColor => purple;
     135           0 :   get textfieldBackgroundColor => purple;
     136           0 :   get textfieldBorderColor => purple;
     137           0 :   get textfieldErrorColor => hotPink;
     138           0 :   get textfieldHintColor => font;
     139           0 :   get textfieldSelectionColor => accent;
     140           0 :   get toolbarIconColor => settings; //darkPurple;
     141           0 :   get topbarColor => header; //softPurple;
     142           0 :   get menuBackgroundColor => accent;
     143           0 :   get menuTextColor => whitePurple;
     144           0 :   get snackbarBackgroundColor => accent;
     145           0 :   get snackbarTextColor => whitePurple;
     146           0 :   get chatImageColor => purple;
     147             : }

Generated by: LCOV version 1.14