forked from forgejo/forgejo
Replace deprecated String.prototype.substr() with String.prototype.slice() (#18796)
String.prototype.substr() is deprecated (see https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/String/substr) so we replace it with the slice() method which works similarily but isn't deprecated. Signed-off-by: Tobias Speicher <rootcommander@gmail.com> Co-authored-by: Lunny Xiao <xiaolunwen@gmail.com>
This commit is contained in:
parent
a7b9d44d88
commit
1ab88da0e4
6 changed files with 11 additions and 11 deletions
|
@ -171,9 +171,9 @@ export default function initRepoProject() {
|
|||
}
|
||||
|
||||
function setLabelColor(label, color) {
|
||||
const red = getRelativeColor(parseInt(color.substr(1, 2), 16));
|
||||
const green = getRelativeColor(parseInt(color.substr(3, 2), 16));
|
||||
const blue = getRelativeColor(parseInt(color.substr(5, 2), 16));
|
||||
const red = getRelativeColor(parseInt(color.slice(1, 3), 16));
|
||||
const green = getRelativeColor(parseInt(color.slice(3, 5), 16));
|
||||
const blue = getRelativeColor(parseInt(color.slice(5, 7), 16));
|
||||
const luminance = 0.2126 * red + 0.7152 * green + 0.0722 * blue;
|
||||
|
||||
if (luminance > 0.179) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue