mirror of
https://github.com/Noratrieb/slides.git
synced 2026-01-16 09:25:06 +01:00
parent
290c251c7e
commit
d1f6e6cce9
1 changed files with 2 additions and 2 deletions
|
|
@ -192,8 +192,8 @@ export default class Backgrounds {
|
||||||
// color, no class will be added
|
// color, no class will be added
|
||||||
let contrastColor = data.backgroundColor;
|
let contrastColor = data.backgroundColor;
|
||||||
|
|
||||||
// If no bg color was found, check the computed background
|
// If no bg color was found, or it cannot be converted by colorToRgb, check the computed background
|
||||||
if( !contrastColor ) {
|
if( !contrastColor || !colorToRgb( contrastColor ) ) {
|
||||||
let computedBackgroundStyle = window.getComputedStyle( element );
|
let computedBackgroundStyle = window.getComputedStyle( element );
|
||||||
if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
|
if( computedBackgroundStyle && computedBackgroundStyle.backgroundColor ) {
|
||||||
contrastColor = computedBackgroundStyle.backgroundColor;
|
contrastColor = computedBackgroundStyle.backgroundColor;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue