Sha256: 3ccaff5b07113cb3775155aa0fff999efe1bcd0ef260fbc443c1c1ecd6d66722

Contents?: true

Size: 777 Bytes

Versions: 3

Compression:

Stored size: 777 Bytes

Contents

require_relative '../../lib/squib'

# Choose between black and white color theme for type snake
#   * Allow using white snake cards with black text or
#     black snake cards with white text
color = 'white'

cards = Squib.csv file: '_switch_color_data.csv'

Squib::Deck.new cards: cards['Type'].size do

    background_color = cards['Type'].map do |t|
        if color == 'black' && t == "Snake" then
            "black"
        else
            "white"
        end
    end
    background color: background_color

    text_color = cards['Type'].map do |t|
        if color == 'black' && t == "Snake" then
            "white"
        else
            "black"
        end
    end

    text str: cards['Text'], color: text_color

    save_png prefix: '_switch_color_sample_'

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
squib-0.19.0 samples/colors/_switch_color.rb
squib-0.19.0b samples/colors/_switch_color.rb
squib-0.19.0a samples/colors/_switch_color.rb