Sha256: ca74536f59463bd1e7a627c37639dbf9a37a7d224cf8499700f43c513c6f7b91

Contents?: true

Size: 424 Bytes

Versions: 6

Compression:

Stored size: 424 Bytes

Contents

# frozen_string_literal: true

class Scarpe
  module GlimmerLibUIBackground
    def style
      styles = (super if defined?(super)) || {}
      return styles unless @background_color

      color = if @background_color.is_a?(Range)
        "linear-gradient(45deg, #{@background_color.first}, #{@background_color.last})"
      else
        @background_color
      end

      styles.merge(background: color)
    end
  end
end

Version data entries

6 entries across 6 versions & 2 rubygems

Version Path
scarpe-0.4.0 spikes/glibui/background.rb
scarpe-0.3.0 spikes/glibui/background.rb
scarpe-0.2.2 spikes/glibui/background.rb
lacci-0.2.1 lib/scarpe/glibui/background.rb
scarpe-0.2.1 lib/scarpe/glibui/background.rb
scarpe-0.2.0 lib/scarpe/glibui/background.rb