1. 12 Feb, 2016 3 commits
    • Bram Schoenmakers's avatar
      Fix color tests for garbage/empty values · 93726c4a
      Bram Schoenmakers authored
      The color functions now return a neutral/default color when
      empty/garbage colors are entered in the configuration file.
      
      This addresses issues #69 and #70.
      93726c4a
    • Bram Schoenmakers's avatar
      Introduce -C flag to steer color output · 239a275f
      Bram Schoenmakers authored
      The -C flag takes 0, 1, 16, 256, auto, yes, true, no, false as possible
      values.
      
      If auto, then colors are enabled unless the output is not connected to a
      TTY and is likely not to understand ANSI escape codes. 'auto' is the
      default value.
      
      The config().colors() function either returns 0, 16 or 256 for the
      possible colors that can be displayed.
      
      These values are also recognized by the colors option in the
      configuration file.
      
      This fixes issue #111.
      239a275f
    • Bram Schoenmakers's avatar
      Introduce a Color class · 163fdb91
      Bram Schoenmakers authored
      This color class abstracts away all the possible representations of a
      color in various UIs. These are color objects:
      
      Color(9)              # red
      Color('red')          # red
      Color(196)            # red
      Color('NEUTRAL')      # neutral (resets attributes)
      Color()               # no effect
      
      The configuration stores Color objects now, code that requires colors
      doesn't have to worry about integer representations of colors.
      
      One semantic change: when an empty color is passed as a priority color,
      it will resort to an empty color instead of the neutral color. In
      practice this should have the same visual effect. Test case
      test_priority_color4 is adapted for this.
      
      This commit is the result after an initial refactoring of the color code
      (squashed its history into this one). @mruwek also contributed to this
      refactoring, thanks for the help and the ideas to get to this point.
      163fdb91
  2. 02 Feb, 2016 1 commit
  3. 28 Jan, 2016 1 commit
  4. 22 Jan, 2016 4 commits
  5. 14 Jan, 2016 2 commits
  6. 11 Jan, 2016 2 commits
  7. 08 Jan, 2016 7 commits
  8. 07 Jan, 2016 5 commits
  9. 06 Jan, 2016 6 commits
  10. 05 Jan, 2016 1 commit
  11. 04 Jan, 2016 1 commit
  12. 02 Jan, 2016 2 commits
  13. 01 Jan, 2016 3 commits
  14. 31 Dec, 2015 2 commits