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,
cursor: 'text',
backgroundColor: 'transparent'
}
};
}
return (
<a onMouseEnter={::this.handleMouseEnter}

View File

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