mirror of
https://github.com/nextcloud/passman.git
synced 2025-12-18 14:09:29 +08:00
Merge 731e570a5b into 07fab75153
This commit is contained in:
commit
2928529756
1 changed files with 13 additions and 2 deletions
|
|
@ -42,6 +42,16 @@
|
||||||
return color;
|
return color;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function whenRgbToHex(input) {
|
||||||
|
var re = /rgb\((\d+),\s*(\d+),\s*(\d+)\)/i;
|
||||||
|
var match = input.match(re);
|
||||||
|
if (match) {
|
||||||
|
var color = match[1] | (match[2] << 8) | (match[3] << 16);
|
||||||
|
return '#' + (0x1000000 + color).toString(16).slice(1);
|
||||||
|
}
|
||||||
|
return input;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
restrict: 'A',
|
restrict: 'A',
|
||||||
scope: {
|
scope: {
|
||||||
|
|
@ -50,7 +60,8 @@
|
||||||
negative: '='
|
negative: '='
|
||||||
},
|
},
|
||||||
link: function (scope, el) {
|
link: function (scope, el) {
|
||||||
var _color = jQuery('#header').css('background-color');
|
var _color = whenRgbToHex(
|
||||||
|
jQuery('#header').css('background-color'));
|
||||||
var _bg = _color;
|
var _bg = _color;
|
||||||
if (scope.negative) {
|
if (scope.negative) {
|
||||||
_bg = invertColor(_bg);
|
_bg = invertColor(_bg);
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue