| 69 | } |
| 70 | |
| 71 | func (c *ColorScheme) Muted(t string) string { |
| 72 | // Fallback to previous logic if accessible colors preview is disabled. |
| 73 | if !c.Accessible { |
| 74 | return c.Gray(t) |
| 75 | } |
| 76 | |
| 77 | // Muted text is only stylized if color is enabled. |
| 78 | if !c.Enabled { |
| 79 | return t |
| 80 | } |
| 81 | |
| 82 | switch c.Theme { |
| 83 | case LightTheme: |
| 84 | return lightThemeMuted(t) |
| 85 | case DarkTheme: |
| 86 | return darkThemeMuted(t) |
| 87 | default: |
| 88 | return t |
| 89 | } |
| 90 | } |
| 91 | |
| 92 | func (c *ColorScheme) Mutedf(t string, args ...interface{}) string { |
| 93 | return c.Muted(fmt.Sprintf(t, args...)) |