Merge pull request #55 from threepointone/master

pass lint checks
This commit is contained in:
Dan Abramov 2015-08-12 21:52:11 +03:00
commit d6aba950fc
2 changed files with 12 additions and 12 deletions

View File

@ -68,7 +68,7 @@ export default class LogMonitorButton extends React.Component {
opacity: 0.2, opacity: 0.2,
cursor: 'text', cursor: 'text',
backgroundColor: 'transparent' backgroundColor: 'transparent'
} };
} }
return ( return (
<a onMouseEnter={::this.handleMouseEnter} <a onMouseEnter={::this.handleMouseEnter}

View File

@ -1,16 +1,16 @@
export default function(hex, lum) { export default function(hexColor, lightness) {
hex = String(hex).replace(/[^0-9a-f]/gi, ""); let hex = String(hexColor).replace(/[^0-9a-f]/gi, '');
if (hex.length < 6) { if (hex.length < 6) {
hex = hex.replace(/(.)/g, '$1$1'); hex = hex.replace(/(.)/g, '$1$1');
} }
lum = lum || 0; let lum = lightness || 0;
var rgb = "#", let rgb = '#';
c; let c;
for (var i = 0; i < 3; ++i) { for (let i = 0; i < 3; ++i) {
c = parseInt(hex.substr(i * 2, 2), 16); c = parseInt(hex.substr(i * 2, 2), 16);
c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16); c = Math.round(Math.min(Math.max(0, c + (c * lum)), 255)).toString(16);
rgb += ("00" + c).substr(c.length); rgb += ('00' + c).substr(c.length);
} }
return rgb; return rgb;
}; }