diff options
author | Julius Härtl <jus@bitgrid.net> | 2018-01-04 17:35:56 +0100 |
---|---|---|
committer | Julius Härtl <jus@bitgrid.net> | 2018-01-08 10:31:34 +0100 |
commit | e4f9c75a050a861550885af0eb33ead9e8778859 (patch) | |
tree | 302b80792a5ff2cd225f3cee3d8bb43e2c844320 /apps/theming/css/theming.scss | |
parent | ecf885046459253fbe4599600db241b9e36fa61a (diff) | |
download | nextcloud-server-e4f9c75a050a861550885af0eb33ead9e8778859.tar.gz nextcloud-server-e4f9c75a050a861550885af0eb33ead9e8778859.zip |
Adjust theming color calculations using sRGB luma
based on https://robots.thoughtbot.com/closer-look-color-lightness
Signed-off-by: Julius Härtl <jus@bitgrid.net>
Diffstat (limited to 'apps/theming/css/theming.scss')
-rw-r--r-- | apps/theming/css/theming.scss | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/apps/theming/css/theming.scss b/apps/theming/css/theming.scss index 4474c232d94..58bc1f5464e 100644 --- a/apps/theming/css/theming.scss +++ b/apps/theming/css/theming.scss @@ -1,3 +1,12 @@ +/** Calculate luma as it is also used in OCA\Theming\Util::calculateLuma */ +@function luma($c) { + $-local-red: red(rgba($c, 1.0)); + $-local-green: green(rgba($c, 1.0)); + $-local-blue: blue(rgba($c, 1.0)); + + @return (0.2126 * $-local-red + 0.7152 * $-local-green + 0.0722 * $-local-blue) / 255; +} + .nc-theming-main-background { background-color: $color-primary; } @@ -10,7 +19,7 @@ color: $color-primary-text; } -@if (lightness($color-primary) > 55) { +@if (luma($color-primary) > 0.6) { .searchbox input[type="search"] { background: transparent url('../../../core/img/actions/search.svg') no-repeat 6px center; } @@ -90,8 +99,8 @@ input.primary, color: $color-primary-text; } -@if (lightness($color-primary) > 50) { - #body-login #submit-icon.icon-confirm-white { +@if (luma($color-primary) > 0.6) { + #body-login #submit-wrapper .icon-confirm-white { background-image: url('../../../core/img/actions/confirm.svg'); } } |