migrate admin settings

This commit is contained in:
Simon Vieille
2025-04-10 19:54:03 +02:00
parent 8c5c43dafa
commit f9c3f96919
25 changed files with 1024 additions and 108 deletions
+31
View File
@@ -2,6 +2,8 @@
namespace OCA\SideMenu\Service;
use OCA\Theming\ThemingDefaults;
/**
* class Color.
*
@@ -9,6 +11,10 @@ namespace OCA\SideMenu\Service;
*/
class Color
{
public function __construct(protected ThemingDefaults $theming)
{
}
/**
* @thanks https://stackoverflow.com/posts/54393956/revision
*/
@@ -31,4 +37,29 @@ class Color
return '#'.implode($hexCode);
}
public function getPrimaryColor()
{
return $this->theming->getColorPrimary();
}
public function getLightenPrimaryColor()
{
return $this->adjustBrightness($this->getPrimaryColor(), 0.2);
}
public function getDarkenPrimaryColor()
{
return $this->adjustBrightness($this->getPrimaryColor(), -0.2);
}
public function getDarkenPrimaryColor2()
{
return $this->adjustBrightness($this->getPrimaryColor(), -0.3);
}
public function getTextColorPrimary()
{
return $this->theming->getTextColorPrimary();
}
}