Sha256: 274429ccffa245c5ddaa10f884a98ce58f6703f2f8dcf1cde2e1b482517dddf7

Contents?: true

Size: 863 Bytes

Versions: 161

Compression:

Stored size: 863 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

161 entries across 148 versions & 16 rubygems

Version Path
challah-1.0.0.beta vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-0.9.1.beta.3 vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-0.9.1.beta vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-0.9.0 vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/highline-1.6.14/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/highline-1.6.14/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.3/vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-rolls-0.2.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
challah-0.8.3 vendor/bundle/gems/highline-1.6.15/examples/color_scheme.rb
challah-0.8.3 vendor/bundle/gems/highline-1.6.14/examples/color_scheme.rb
challah-0.8.1 vendor/bundle/gems/highline-1.6.14/examples/color_scheme.rb
highline-1.6.15 examples/color_scheme.rb
challah-rolls-0.1.0 vendor/bundle/gems/challah-0.8.0.pre/vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
challah-rolls-0.1.0 vendor/bundle/gems/highline-1.6.14/examples/color_scheme.rb
challah-rolls-0.1.0 vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
challah-0.8.0.pre vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
challah-0.7.1 vendor/bundle/gems/highline-1.6.13/examples/color_scheme.rb
highline-1.6.14 examples/color_scheme.rb