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 0 : get toolbarBackgroundColor => deepPurple; 88 8 : get topbarColor => header; //darkGreyPurple; 89 4 : get menuBackgroundColor => accent; 90 0 : get menuTextColor => darkGreyPurple; 91 8 : get snackbarBackgroundColor => accent; 92 8 : get snackbarTextColor => whitePurple; 93 0 : get chatImageColor => purple; 94 : } 95 : 96 : class CwtchLight extends OpaqueThemeType { 97 0 : static final Color background = whitePurple; 98 0 : static final Color header = softPurple; 99 0 : static final Color userBubble = purple; 100 0 : static final Color peerBubble = softPurple; 101 0 : static final Color font = darkPurple; 102 0 : static final Color settings = darkPurple; 103 0 : static final Color accent = hotPink; 104 : 105 0 : get theme => cwtch_theme; 106 0 : get mode => mode_light; 107 : 108 0 : get backgroundHilightElementColor => softPurple; 109 0 : get backgroundMainColor => background; //whitePurple; 110 0 : get backgroundPaneColor => background; //whitePurple; 111 0 : get defaultButtonColor => accent; // hotPink; 112 0 : get defaultButtonDisabledColor => softGrey; 113 0 : get defaultButtonTextColor => whitePurple; // ? 114 0 : get dropShadowColor => purple; 115 0 : get hilightElementColor => purple; 116 0 : get mainTextColor => settings; 117 0 : get messageFromMeBackgroundColor => userBubble; //brightPurple; 118 0 : get messageFromMeTextColor => font; //mainTextColor; 119 0 : get messageFromOtherBackgroundColor => peerBubble; //purple; 120 0 : get messageFromOtherTextColor => font; //darkPurple; 121 0 : get messageSelectionColor => accent; 122 0 : get portraitBackgroundColor => softPurple; 123 0 : get portraitBlockedBorderColor => softGrey; 124 0 : get portraitBlockedTextColor => softGrey; 125 0 : get portraitContactBadgeColor => accent; 126 0 : get portraitContactBadgeTextColor => whitePurple; 127 0 : get portraitOfflineBorderColor => greyPurple; 128 0 : get portraitOnlineBorderColor => greyPurple; 129 0 : get portraitOnlineAwayColor => Color(0xFFFFF59D); 130 0 : get portraitOnlineBusyColor => Color(0xFFEF9A9A); 131 0 : get portraitProfileBadgeColor => accent; 132 0 : get portraitProfileBadgeTextColor => whitePurple; 133 0 : get scrollbarDefaultColor => accent; 134 0 : get sendHintTextColor => purple; 135 0 : get chatReactionIconColor => purple; 136 0 : get textfieldBackgroundColor => purple; 137 0 : get textfieldBorderColor => purple; 138 0 : get textfieldErrorColor => hotPink; 139 0 : get textfieldHintColor => font; 140 0 : get textfieldSelectionColor => accent; 141 0 : get toolbarIconColor => settings; //darkPurple; 142 0 : get toolbarBackgroundColor => accent; 143 0 : get topbarColor => header; //softPurple; 144 0 : get menuBackgroundColor => accent; 145 0 : get menuTextColor => whitePurple; 146 0 : get snackbarBackgroundColor => accent; 147 0 : get snackbarTextColor => whitePurple; 148 0 : get chatImageColor => purple; 149 : }