| 122 | } |
| 123 | |
| 124 | func init() { |
| 125 | // We do not adapt the color based on whether the terminal is light or dark. |
| 126 | // Doing so would require a round-trip between the program and the terminal |
| 127 | // due to the OSC query and response. |
| 128 | DefaultStyles = Styles{ |
| 129 | Code: pretty.Style{ |
| 130 | ifTerm(pretty.XPad(1, 1)), |
| 131 | pretty.FgColor(Color("#ED567A")), |
| 132 | pretty.BgColor(Color("#2C2C2C")), |
| 133 | }, |
| 134 | DateTimeStamp: pretty.Style{ |
| 135 | pretty.FgColor(brightBlue), |
| 136 | }, |
| 137 | Error: pretty.Style{ |
| 138 | pretty.FgColor(red), |
| 139 | }, |
| 140 | Field: pretty.Style{ |
| 141 | pretty.XPad(1, 1), |
| 142 | pretty.FgColor(Color("#FFFFFF")), |
| 143 | pretty.BgColor(Color("#2B2A2A")), |
| 144 | }, |
| 145 | Fuchsia: pretty.Style{ |
| 146 | pretty.FgColor(brightMagenta), |
| 147 | }, |
| 148 | FocusedPrompt: pretty.Style{ |
| 149 | pretty.FgColor(white), |
| 150 | pretty.Wrap("> ", ""), |
| 151 | pretty.FgColor(brightBlue), |
| 152 | }, |
| 153 | Hyperlink: pretty.Style{ |
| 154 | pretty.FgColor(magenta), |
| 155 | pretty.Underline(), |
| 156 | }, |
| 157 | Keyword: pretty.Style{ |
| 158 | pretty.FgColor(green), |
| 159 | }, |
| 160 | Placeholder: pretty.Style{ |
| 161 | pretty.FgColor(magenta), |
| 162 | }, |
| 163 | Prompt: pretty.Style{ |
| 164 | pretty.FgColor(white), |
| 165 | pretty.Wrap(" ", ""), |
| 166 | }, |
| 167 | Warn: pretty.Style{ |
| 168 | pretty.FgColor(yellow), |
| 169 | }, |
| 170 | Wrap: pretty.Style{ |
| 171 | pretty.LineWrap(80), |
| 172 | }, |
| 173 | } |
| 174 | } |
| 175 | |
| 176 | // ValidateNotEmpty is a helper function to disallow empty inputs! |
| 177 | func ValidateNotEmpty(s string) error { |