Sha256: a53a55fe159369aa7f707dbef2410f0cf55c7355fc767b0e4a75da9938c2e86c

Contents?: true

Size: 861 Bytes

Versions: 58

Compression:

Stored size: 861 Bytes

Contents

#!/usr/bin/env ruby -w

# color_scheme.rb
#
#  Created by Jeremy Hinegardner on 2007-01-24
#  Copyright 2007 Jeremy Hinegardner.  All rights reserved

require 'rubygems'
require 'highline/import'

# Create a color scheme, naming color patterns with symbol names.
ft = HighLine::ColorScheme.new do |cs|
        cs[:headline]        = [ :bold, :yellow, :on_black ]
        cs[:horizontal_line] = [ :bold, :white, :on_blue]
        cs[:even_row]        = [ :green ]
        cs[:odd_row]         = [ :magenta ]
     end

# Assign that color scheme to HighLine...
HighLine.color_scheme = ft

# ...and use it.
say("<%= color('Headline', :headline) %>")
say("<%= color('-'*20, :horizontal_line) %>")

# Setup a toggle for rows.
i = true
("A".."D").each do |row|
    row_color = i ? :even_row : :odd_row
    say("<%= color('#{row}', '#{row_color}') %>")
    i = !i
end

Version data entries

58 entries across 57 versions & 10 rubygems

Version Path
brakeman-4.3.1 bundle/ruby/2.5.0/gems/highline-1.7.10/examples/color_scheme.rb
brakeman-4.3.0 bundle/ruby/2.5.0/gems/highline-1.7.10/examples/color_scheme.rb
brakeman-4.2.1 bundle/ruby/2.5.0/gems/highline-1.7.10/examples/color_scheme.rb
brakeman-4.2.0 bundle/ruby/2.3.0/gems/highline-1.7.10/examples/color_scheme.rb
brakeman-4.1.1 bundle/ruby/2.3.0/gems/highline-1.7.10/examples/color_scheme.rb
brakeman-4.1.0 bundle/ruby/2.3.0/gems/highline-1.7.10/examples/color_scheme.rb
highline-1.7.10 examples/color_scheme.rb
brakeman-4.0.1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-4.0.1.pre1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-4.0.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.7.2 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.7.1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.7.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
highline-2.0.0.pre.develop.9 examples/color_scheme.rb
brakeman-3.6.2 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.6.1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.6.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.5.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.4.1 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb
brakeman-3.4.0 bundle/ruby/2.3.0/gems/highline-1.7.8/examples/color_scheme.rb