()
| 338 | } |
| 339 | |
| 340 | func LoadColorPatterns() { |
| 341 | |
| 342 | start := time.Now() |
| 343 | |
| 344 | path := string(configs.GetFilePathsConfig().DataFiles) + `/color-patterns.yaml` |
| 345 | |
| 346 | bytes, err := util.ReadFile(path) |
| 347 | if err != nil { |
| 348 | panic(errors.Wrap(err, `filepath: `+path)) |
| 349 | } |
| 350 | |
| 351 | clear(numericPatterns) |
| 352 | clear(ShortTagPatterns) |
| 353 | colorsCompiled = false |
| 354 | |
| 355 | err = yaml.Unmarshal(bytes, &numericPatterns) |
| 356 | if err != nil { |
| 357 | panic(errors.Wrap(err, `filepath: `+path)) |
| 358 | } |
| 359 | |
| 360 | CompileColorPatterns() |
| 361 | |
| 362 | mudlog.Info("...LoadColorPatterns()", "loadedCount", len(numericPatterns), "Time Taken", time.Since(start)) |
| 363 | |
| 364 | /* |
| 365 | for _, name := range GetColorPatternNames() { |
| 366 | mudlog.Info("Color Test (Patterns)", "name", name, |
| 367 | "(default)", ansitags.Parse(ApplyColorPattern(`Color test pattern`, name)), |
| 368 | "Stretch", ansitags.Parse(ApplyColorPattern(`Color test pattern`, name, Stretch)), |
| 369 | "Words", ansitags.Parse(ApplyColorPattern(`Color test pattern color test pattern`, name, Words)), |
| 370 | ) |
| 371 | } |
| 372 | */ |
| 373 | } |
no test coverage detected