mirror of
https://github.com/nextcloud/passman.git
synced 2025-12-11 14:16:07 +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;
|
||||
}
|
||||
|
||||
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 {
|
||||
restrict: 'A',
|
||||
scope: {
|
||||
|
|
@ -50,7 +60,8 @@
|
|||
negative: '='
|
||||
},
|
||||
link: function (scope, el) {
|
||||
var _color = jQuery('#header').css('background-color');
|
||||
var _color = whenRgbToHex(
|
||||
jQuery('#header').css('background-color'));
|
||||
var _bg = _color;
|
||||
if (scope.negative) {
|
||||
_bg = invertColor(_bg);
|
||||
|
|
@ -66,4 +77,4 @@
|
|||
}
|
||||
};
|
||||
}]);
|
||||
}());
|
||||
}());
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue