Sha256: a069731a4351f2122e78eb8b001122f9ddaa2000fe4f5d92d9d3a182e00c904e

Contents?: true

Size: 806 Bytes

Versions: 2

Compression:

Stored size: 806 Bytes

Contents

require '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', col_sep: "\t"

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

2 entries across 2 versions & 1 rubygems

Version Path
squib-0.15.3 samples/colors/_switch_color.rb
squib-0.15.0 samples/colors/_switch_color.rb