aboutsummaryrefslogtreecommitdiffstats
path: root/apps/theming/tests/UtilTest.php
diff options
context:
space:
mode:
authorSimon L <szaimen@e.mail.de>2023-05-11 23:58:53 +0200
committerGitHub <noreply@github.com>2023-05-11 23:58:53 +0200
commit83dcb2061d441c94805a6533be0acc622355de22 (patch)
tree9af6b6b30cb916d3f7068452089941e6dc6a9bda /apps/theming/tests/UtilTest.php
parentd5588f366bc1211405b89a6b6b3b2c61b517c83a (diff)
parent4a89b7ea222d1f7c49dede74e11b88776482f389 (diff)
downloadnextcloud-server-83dcb2061d441c94805a6533be0acc622355de22.tar.gz
nextcloud-server-83dcb2061d441c94805a6533be0acc622355de22.zip
Merge pull request #38159 from nextcloud/enh/noid/fix-themed-icons
fix too dark or bright primary element color
Diffstat (limited to 'apps/theming/tests/UtilTest.php')
-rw-r--r--apps/theming/tests/UtilTest.php29
1 files changed, 22 insertions, 7 deletions
diff --git a/apps/theming/tests/UtilTest.php b/apps/theming/tests/UtilTest.php
index 789107d9fdf..137038acb98 100644
--- a/apps/theming/tests/UtilTest.php
+++ b/apps/theming/tests/UtilTest.php
@@ -105,19 +105,34 @@ class UtilTest extends TestCase {
$this->util->invertTextColor('');
}
- public function testElementColorDefault() {
+ public function testElementColorDefaultBlack() {
$elementColor = $this->util->elementColor("#000000");
- $this->assertEquals('#000000', $elementColor);
+ $this->assertEquals('#4d4d4d', $elementColor);
+ }
+
+ public function testElementColorDefaultWhite() {
+ $elementColor = $this->util->elementColor("#ffffff");
+ $this->assertEquals('#b3b3b3', $elementColor);
}
- public function testElementColorOnDarkBackground() {
+ public function testElementColorBlackOnDarkBackground() {
$elementColor = $this->util->elementColor("#000000", false);
- $this->assertEquals('#8c8c8c', $elementColor);
+ $this->assertEquals('#4d4d4d', $elementColor);
+ }
+
+ public function testElementColorBlackOnBrightBackground() {
+ $elementColor = $this->util->elementColor("#000000", true);
+ $this->assertEquals('#000000', $elementColor);
+ }
+
+ public function testElementColorWhiteOnBrightBackground() {
+ $elementColor = $this->util->elementColor('#ffffff', true);
+ $this->assertEquals('#b3b3b3', $elementColor);
}
- public function testElementColorOnBrightBackground() {
- $elementColor = $this->util->elementColor('#ffffff');
- $this->assertEquals('#aaaaaa', $elementColor);
+ public function testElementColorWhiteOnDarkBackground() {
+ $elementColor = $this->util->elementColor('#ffffff', false);
+ $this->assertEquals('#ffffff', $elementColor);
}
public function testGenerateRadioButtonWhite() {