mirror of
https://github.com/reduxjs/redux-devtools.git
synced 2024-11-29 13:03:55 +03:00
commit
d6aba950fc
|
@ -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}
|
||||||
|
|
|
@ -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;
|
||||||
};
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user