diff --git a/README.md b/README.md index 486ff6f..cd6bea9 100644 --- a/README.md +++ b/README.md @@ -34,8 +34,8 @@ If this option is selected, only the last word of the author's name will be disp Default date format is `YYYY-MM-DD`. This feature is backed by [moment.js](http://momentjs.com/). Any formats [supported by moment](http://momentjs.com/docs/#/displaying/format/) are valid here. -### Color commit authors -If this option is selected, the commit authors will appear with a unique color to make them easily recognisable. +### Color Commit +If this option is selected, the commit authors or commit will appear with a unique color to make them easily recognisable. ### Custom Remote Repo Url This plugin will first check to see if your repo is backed by **GitHub**, **Bitbucket**, or **GitLab** so nothing is required if your repo is hosted on one of these. diff --git a/lib/components/BlameLine.js b/lib/components/BlameLine.js index a6b7296..42040f8 100644 --- a/lib/components/BlameLine.js +++ b/lib/components/BlameLine.js @@ -37,12 +37,20 @@ export default function BlameLine(props) { showOnlyLastNames, showHash, viewCommitUrl, - colorCommitAuthors, + colorCommit, } = props; const displayName = showOnlyLastNames ? lastWord(author) : author; + let color; + if (colorCommit === 'hash') { + color = stringToColour(hash); + } else if (colorCommit === 'author') { + color = stringToColour(author); + } else { + color = null; + } return ( -