• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

atinc / ngx-tethys / 12474c83-a733-45de-92ff-bc2463a7e2b9

14 Nov 2024 03:24AM UTC coverage: 90.319% (-0.08%) from 90.395%
12474c83-a733-45de-92ff-bc2463a7e2b9

Pull #3229

circleci

minlovehua
feat(watermark): support dark theme for watermark component #TINFR-501 
Pull Request #3229: feat(watermark): support dark theme for watermark component #TINFR-501

5511 of 6750 branches covered (81.64%)

Branch coverage included in aggregate %.

40 of 48 new or added lines in 3 files covered. (83.33%)

4 existing lines in 2 files now uncovered.

13175 of 13939 relevant lines covered (94.52%)

997.35 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

63.33
/src/core/theme/store.ts
1
import { Injectable, signal } from '@angular/core';
2
import { ThyTheme } from './theme';
3

1✔
4
@Injectable({
5
    providedIn: 'root'
4✔
6
})
7
export class ThyThemeStore {
NEW
8
    readonly theme = signal<ThyTheme>(ThyTheme.light);
×
9

10
    constructor() {}
11

7!
NEW
12
    setTheme(theme: ThyTheme) {
×
13
        this.theme.set(theme);
14
    }
7!
15

7!
NEW
16
    normalizeColor(color: string | string[]): string {
×
17
        if (typeof color === 'string') {
18
            return color;
7!
19
        }
7!
NEW
20
        if (Array.isArray(color)) {
×
21
            if (color.length === 1) {
22
                return color[0];
23
            }
7✔
24

25
            if (color.length > 1) {
26
                if (this.isDark()) {
27
                    return color[1];
28
                } else {
29
                    return color[0];
7✔
30
                }
7!
31
            }
32
        }
33
    }
1✔
34

35
    isDark() {
1✔
36
        const theme = this.theme();
37
        return (
38
            theme === ThyTheme.dark ||
39
            (theme === ThyTheme.system && window.matchMedia && window.matchMedia('(prefers-color-scheme: dark)').matches)
40
        );
41
    }
42
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2025 Coveralls, Inc