diff --git a/src/Interfaces/Theme.php b/src/Interfaces/Theme.php index 3a00f1a..4e67757 100644 --- a/src/Interfaces/Theme.php +++ b/src/Interfaces/Theme.php @@ -2,13 +2,13 @@ namespace SimonHamp\TheOg\Interfaces; -use Intervention\Image\Colors\Rgb\Color; +use Intervention\Image\Interfaces\ColorInterface; interface Theme { public function accentColor(string $color): self; - public function getAccentColor(): Color; + public function getAccentColor(): ColorInterface; public function background(Background $background): self; @@ -16,7 +16,7 @@ public function getBackground(): ?Background; public function backgroundColor(string $color): self; - public function getBackgroundColor(): Color; + public function getBackgroundColor(): ColorInterface; public function backgroundOpacity(float $opacity): self; @@ -28,7 +28,7 @@ public function getBackgroundUrl(): ?string; public function baseColor(string $color): self; - public function getBaseColor(): Color; + public function getBaseColor(): ColorInterface; public function baseFont(Font $font): self; @@ -36,15 +36,15 @@ public function getBaseFont(): Font; public function borderColor(string $color): self; - public function getBorderColor(): Color; + public function getBorderColor(): ColorInterface; public function callToActionBackgroundColor(string $color): self; - public function getCallToActionBackgroundColor(): Color; + public function getCallToActionBackgroundColor(): ColorInterface; public function callToActionColor(string $color): self; - public function getCallToActionColor(): Color; + public function getCallToActionColor(): ColorInterface; public function callToActionFont(Font $font): self; @@ -52,7 +52,7 @@ public function getCallToActionFont(): Font; public function descriptionColor(string $color): self; - public function getDescriptionColor(): Color; + public function getDescriptionColor(): ColorInterface; public function descriptionFont(Font $font): self; @@ -60,7 +60,7 @@ public function getDescriptionFont(): Font; public function titleColor(string $color): self; - public function getTitleColor(): Color; + public function getTitleColor(): ColorInterface; public function titleFont(Font $font): self; @@ -68,7 +68,7 @@ public function getTitleFont(): Font; public function urlColor(string $color): self; - public function getUrlColor(): Color; + public function getUrlColor(): ColorInterface; public function urlFont(Font $font): self; diff --git a/src/Theme/AbstractTheme.php b/src/Theme/AbstractTheme.php index ee81c14..676a4e1 100644 --- a/src/Theme/AbstractTheme.php +++ b/src/Theme/AbstractTheme.php @@ -3,6 +3,7 @@ namespace SimonHamp\TheOg\Theme; use Intervention\Image\Colors\Rgb\Color; +use Intervention\Image\Interfaces\ColorInterface; use SimonHamp\TheOg\Background as BuiltInBackground; use SimonHamp\TheOg\Interfaces\Background; use SimonHamp\TheOg\Interfaces\Font; @@ -39,7 +40,7 @@ public function accentColor(string $color): self return $this; } - public function getAccentColor(): Color + public function getAccentColor(): ColorInterface { return Color::create($this->accentColor); } @@ -76,7 +77,7 @@ public function backgroundColor(string $color): self return $this; } - public function getBackgroundColor(): Color + public function getBackgroundColor(): ColorInterface { return Color::create($this->backgroundColor); } @@ -98,7 +99,7 @@ public function baseColor(string $color): self return $this; } - public function getBaseColor(): Color + public function getBaseColor(): ColorInterface { return Color::create($this->baseColor); } @@ -121,7 +122,7 @@ public function borderColor(string $color): self return $this; } - public function getBorderColor(): Color + public function getBorderColor(): ColorInterface { return Color::create($this->borderColor ?? $this->accentColor); } @@ -132,7 +133,7 @@ public function callToActionBackgroundColor(string $color): self return $this; } - public function getCallToActionBackgroundColor(): Color + public function getCallToActionBackgroundColor(): ColorInterface { return Color::create($this->callToActionBackgroundColor ?? $this->accentColor); } @@ -143,7 +144,7 @@ public function callToActionColor(string $color): self return $this; } - public function getCallToActionColor(): Color + public function getCallToActionColor(): ColorInterface { return Color::create($this->callToActionColor ?? $this->baseColor); } @@ -165,7 +166,7 @@ public function descriptionColor(string $color): self return $this; } - public function getDescriptionColor(): Color + public function getDescriptionColor(): ColorInterface { return Color::create($this->descriptionColor ?? $this->baseColor); } @@ -187,7 +188,7 @@ public function titleColor(string $color): self return $this; } - public function getTitleColor(): Color + public function getTitleColor(): ColorInterface { return Color::create($this->titleColor ?? $this->baseColor); } @@ -209,7 +210,7 @@ public function urlColor(string $color): self return $this; } - public function getUrlColor(): Color + public function getUrlColor(): ColorInterface { return Color::create($this->urlColor ?? $this->accentColor); }