Skip to content

Commit

Permalink
Merge pull request #6 from strigo/fix-error-numbers
Browse files Browse the repository at this point in the history
Fix rendering when text starts with numbers
  • Loading branch information
hellsan631 authored Jul 27, 2017
2 parents 99209a2 + 92e028f commit ad53cc8
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion material-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@
}
}

return this.options.colorPalette[index % this.options.colorPalette.length];
return this.options.colorPalette[Math.abs(index) % this.options.colorPalette.length];
};

// export
Expand Down
2 changes: 1 addition & 1 deletion sample/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
</div>
<div class="col">
<div class="md-avatar-circle">
T
3 T
</div>
</div>
<div class="col">
Expand Down
2 changes: 1 addition & 1 deletion sample/material-avatar.js
Original file line number Diff line number Diff line change
Expand Up @@ -223,7 +223,7 @@
}
}

return this.options.colorPalette[index % this.options.colorPalette.length];
return this.options.colorPalette[Math.abs(index) % this.options.colorPalette.length];
};

// export
Expand Down

0 comments on commit ad53cc8

Please sign in to comment.