Sha256: 58a09db9bec44ea67ab44b1330528b5c3c0a6e3e5055635d4ff36da2b5583c3d

Contents?: true

Size: 709 Bytes

Versions: 25

Compression:

Stored size: 709 Bytes

Contents

module Vedeu

  module Colours

    # The class represents one half (the other, can be found at
    # {Vedeu::Colours::Background}) of a terminal colour escape
    # sequence.
    #
    class Foreground < Vedeu::Colours::Translator

      private

      # @return [String]
      def named_codes
        Vedeu::EscapeSequences::Esc.foreground_codes[colour]
      end

      # @return [String]
      def numbered_prefix
        "\e[38;5;".freeze
      end

      # @return [Vedeu::Colours::Foregrounds]
      def repository
        Vedeu.foreground_colours
      end

      # @return [String]
      def rgb_prefix
        "\e[38;2;%s;%s;%sm".freeze
      end

    end # Foreground

  end # Colours

end # Vedeu

Version data entries

25 entries across 25 versions & 1 rubygems

Version Path
vedeu-0.6.50 lib/vedeu/colours/foreground.rb
vedeu-0.6.49 lib/vedeu/colours/foreground.rb
vedeu-0.6.48 lib/vedeu/colours/foreground.rb
vedeu-0.6.47 lib/vedeu/colours/foreground.rb
vedeu-0.6.46 lib/vedeu/colours/foreground.rb
vedeu-0.6.45 lib/vedeu/colours/foreground.rb
vedeu-0.6.44 lib/vedeu/colours/foreground.rb
vedeu-0.6.43 lib/vedeu/colours/foreground.rb
vedeu-0.6.42 lib/vedeu/colours/foreground.rb
vedeu-0.6.41 lib/vedeu/colours/foreground.rb
vedeu-0.6.40 lib/vedeu/colours/foreground.rb
vedeu-0.6.39 lib/vedeu/colours/foreground.rb
vedeu-0.6.38 lib/vedeu/colours/foreground.rb
vedeu-0.6.37 lib/vedeu/colours/foreground.rb
vedeu-0.6.36 lib/vedeu/colours/foreground.rb
vedeu-0.6.35 lib/vedeu/colours/foreground.rb
vedeu-0.6.34 lib/vedeu/colours/foreground.rb
vedeu-0.6.33 lib/vedeu/colours/foreground.rb
vedeu-0.6.32 lib/vedeu/colours/foreground.rb
vedeu-0.6.31 lib/vedeu/colours/foreground.rb