Sha256: c5fa684d676440c722d6670cdacc819cd1cf2364329cbe00dc85dcec17b5e7de

Contents?: true

Size: 1.06 KB

Versions: 5

Compression:

Stored size: 1.06 KB

Contents

# frozen_string_literal: true

# for browser rendering
module BrowserHelper
  def self.browser_colorize_color(color_updated, atome)
    `document.getElementById(#{atome[:id]}).sheet.cssRules[0].style.backgroundColor = #{color_updated}`
  end

  def self.browser_colorize_shadow(color_updated, atome)
    left = atome[:left]
    top = atome[:top]
    blur = atome[:blur]
    direction = atome[:direction]
    shadow_updated = "#{left}px #{top}px #{blur}px #{color_updated} #{direction}"
    `document.getElementById(#{atome[:id]}).sheet.cssRules[0].style.boxShadow = #{shadow_updated}`
  end

  def self.browser_left_color(_value, _browser_object, _atome)
    puts 'code to write when implementing gradient'
  end

  def self.browser_right_color(_value, _browser_object, _atome)
    puts 'code to write when implementing gradient'
  end

  def self.browser_top_color(_value, _browser_object, _atome)
    puts 'code to write when implementing gradient'
  end

  def self.browser_bottom_color(_value, _browser_object, _atome)
    puts 'code to write when implementing gradient'
  end
end

Version data entries

5 entries across 5 versions & 1 rubygems

Version Path
atome-0.5.3.4 lib/atome/renderers/browser/helpers/color_helper.rb
atome-0.5.3.2 lib/atome/renderers/browser/helpers/color_helper.rb
atome-0.5.2.8 lib/atome/renderers/browser/helpers/color_helper.rb
atome-0.5.2.7 lib/atome/renderers/browser/helpers/color_helper.rb
atome-0.5.2.5 lib/atome/renderers/browser/helpers/color_helper.rb