made dollar green default colour for bitcoin cash

This commit is contained in:
Kadir Sekha 2017-11-17 15:43:04 +09:00
commit be5c7b4728
6 changed files with 31 additions and 14 deletions

View file

@ -14,8 +14,8 @@ $v-text-accent-color: #aaa;
$v-success-color: #fab915;
$v-warning-color: #bb331a;
/* Theme */
$v-default-wallet-color-index: 6;
/* Theme */
$v-default-wallet-color-index: 7;
$v-top-tabs-color: $v-accent-color;
$v-wallet-backup-phrase-color: $v-text-primary-color;
$v-wallet-backup-select-phrase-color: $v-secondary-color;

View file

@ -5,6 +5,7 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
$scope.wallet = wallet;
var walletId = wallet.credentials.walletId;
var config = configService.getSync();
var defaults = configService.getDefaults();
config.colorFor = config.colorFor || {};
var retries = 3;
@ -27,7 +28,11 @@ angular.module('copayApp.controllers').controller('preferencesColorController',
};
function getColorDefault() {
return rgb2hex(window.getComputedStyle(document.getElementsByClassName('wallet-color-default')[0]).color);
if ($scope.wallet.coin == 'bch') {
return defaults.bitcoinCashWalletColor;
} else {
return defaults.bitcoinWalletColor;
}
};
function getColorCount() {

View file

@ -106,7 +106,9 @@ angular.module('copayApp.services').factory('configService', function(storageSer
},
bitcoinAlias: 'btc',
bitcoinCashAlias: 'bch'
bitcoinCashAlias: 'bch',
bitcoinWalletColor: '#fab915', // Observatory
bitcoinCashWalletColor: '#26B03C' // Dollar Green
};
var configCache = null;

View file

@ -33,7 +33,10 @@ angular.module('copayApp.services')
configService.whenAvailable(function(config) {
wallet.usingCustomBWS = config.bwsFor && config.bwsFor[wallet.id] && (config.bwsFor[wallet.id] != defaults.bws.url);
wallet.name = (config.aliasFor && config.aliasFor[wallet.id]) || wallet.credentials.walletName;
wallet.color = (config.colorFor && config.colorFor[wallet.id]);
wallet.color = (config.colorFor && config.colorFor[wallet.id])
|| (wallet.coin == 'bch'
? defaults.bitcoinCashWalletColor
: defaults.bitcoinWalletColor);
wallet.email = config.emailFor && config.emailFor[wallet.id];
});
}

View file

@ -33,18 +33,20 @@ $v-wallet-color-map: (
3: (color: #d0b136, name: 'Metallic Gold'),
4: (color: #9edd72, name: 'Feijoa'),
5: (color: #29bb9c, name: 'Shamrock'),
6: (color: #fab915, name: 'Observatory'),
7: (color: #77dada, name: 'Turquoise Blue'),
8: (color: #4a90e2, name: 'Cornflower Blue'),
9: (color: #484ed3, name: 'Free Speech Blue'),
10: (color: #9b59b6, name: 'Deep Lilac'),
11: (color: #e856ef, name: 'Free Speech Magenta'),
12: (color: #ff599e, name: 'Brilliant Rose'),
13: (color: #7a8c9e, name: 'Light Slate Grey')
6: (color: #26B03C, name: 'Dollar Green'),
7: (color: #fab915, name: 'Observatory'),
8: (color: #77dada, name: 'Turquoise Blue'),
9: (color: #4a90e2, name: 'Cornflower Blue'),
10: (color: #484ed3, name: 'Free Speech Blue'),
11: (color: #9b59b6, name: 'Deep Lilac'),
12: (color: #e856ef, name: 'Free Speech Magenta'),
13: (color: #ff599e, name: 'Brilliant Rose'),
14: (color: #7a8c9e, name: 'Light Slate Grey')
) !default;
/* Theme */
$v-default-wallet-color-index: 8 !default; // See $v-wallet-color-map
$v-default-wallet-color-index: 7 !default; // See $v-wallet-color-map
$v-default-cashwallet-color-index: 6 !default; // See $v-wallet-color-map
$v-subtle-box-shadow: 0 1px 2px rgba(0, 0, 0, 0.25) !default;
$v-hovering-box-shadow: 0px 6px 12px 0px rgba(0, 0, 0, 0.3) !default;
$v-subtle-radius: 3px !default;

View file

@ -8,6 +8,7 @@
/* background-color and color defaults should be the same */
$default-wallet-color: map-get( map-get($v-wallet-color-map, $v-default-wallet-color-index) , color);
$default-cashwallet-color: map-get( map-get($v-wallet-color-map, $v-default-cashwallet-color-index) , color);
.wallet-background-color-default {
background-color: $default-wallet-color;
@ -17,6 +18,10 @@ $default-wallet-color: map-get( map-get($v-wallet-color-map, $v-default-wallet-c
color: $default-wallet-color;
}
.cashwallet-color-default {
color: $default-cashwallet-color;
}
/* generate classes for all colors */
@each $id, $map in $v-wallet-color-map {
.wallet-color-#{$id} {