diff --git a/components/Carbon.js b/components/Carbon.js index 5d0fd80..5ca8ea7 100644 --- a/components/Carbon.js +++ b/components/Carbon.js @@ -99,6 +99,7 @@ class Carbon extends React.PureComponent { theme={config.windowTheme} code={this.props.children} copyable={this.props.copyable} + light={config.theme.light} /> ) : null} { - var r, g, b, hsp - color = +("0x" + color.slice(1).replace(color.length < 5 && /./g, '$&$&')) - r = color >> 16 - g = color >> 8 & 255 - b = color & 255; - hsp = Math.sqrt( - 0.299 * (r * r) + - 0.587 * (g * g) + - 0.114 * (b * b) - ) - return hsp > 127.5 - } - return (
( +export default ({ theme, copyable, code, light }) => (
{theme === 'bw' ? : }
@@ -73,6 +73,7 @@ export default ({ theme, copyable, code }) => ( border: none; text-align: center; font-size: 14px; + color: ${light ? COLORS.BLACK : COLORS.SECONDARY}; } .copy-button {