Created
          December 22, 2024 00:33 
        
      - 
      
 - 
        
Save narslan/fdb5ffa44b9ec3a340a8d693b602bc79 to your computer and use it in GitHub Desktop.  
    print in color
  
        
  
    
      This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
      Learn more about bidirectional Unicode characters
    
  
  
    
  | #include <fmt/color.h> | |
| #include <string_view> | |
| template <typename... T> | |
| void printg(std::string_view format, T... args) | |
| { | |
| fmt::print(fmt::emphasis::bold | fg(fmt::color::green), format, args...); | |
| } | |
| template <typename... T> | |
| void printr(std::string_view format, T... args) | |
| { | |
| fmt::print(fmt::emphasis::bold | fg(fmt::color::chocolate), format, args...); | |
| } | |
| template <typename... T> | |
| void printb(std::string_view format, T... args) | |
| { | |
| fmt::print(fmt::emphasis::bold | fg(fmt::color::blue_violet), format, args...); | |
| } | 
  
    Sign up for free
    to join this conversation on GitHub.
    Already have an account?
    Sign in to comment