|
@@ -1131,18 +1131,27 @@
|
|
|
if( data.backgroundPosition ) contentElement.style.backgroundPosition = data.backgroundPosition;
|
|
|
if( data.backgroundOpacity ) contentElement.style.opacity = data.backgroundOpacity;
|
|
|
|
|
|
-
|
|
|
+
|
|
|
|
|
|
-
|
|
|
- var computedBackgroundStyle = window.getComputedStyle( element );
|
|
|
- if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
|
|
|
- var rgb = colorToRgb( computedBackgroundStyle.backgroundColor );
|
|
|
+
|
|
|
+ var contrastColor = data.backgroundColor;
|
|
|
+
|
|
|
+
|
|
|
+ if( !contrastColor ) {
|
|
|
+ var computedBackgroundStyle = window.getComputedStyle( element );
|
|
|
+ if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
|
|
|
+ contrastColor = computedBackgroundStyle.backgroundColor;
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
+ if( contrastColor ) {
|
|
|
+ var rgb = colorToRgb( contrastColor );
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if( rgb && rgb.a !== 0 ) {
|
|
|
- if( colorBrightness( computedBackgroundStyle.backgroundColor ) < 128 ) {
|
|
|
+ if( colorBrightness( contrastColor ) < 128 ) {
|
|
|
slide.classList.add( 'has-dark-background' );
|
|
|
}
|
|
|
else {
|