Class: Diffux::SnapshotComparisonImage::Gutter

Inherits:
Base
  • Object
show all
Defined in:
lib/diffux_core/snapshot_comparison_image/gutter.rb

Overview

This class renders a gutter-column with a color representing the type of change that has happened.

Constant Summary collapse

WIDTH =
10
GRAY =
ChunkyPNG::Color.from_hex '#cccccc'

Constants inherited from Base

Base::BASE_ALPHA, Base::BASE_DIFF_ALPHA, Base::BASE_OPACITY, Base::GREEN, Base::MAGENTA, Base::RED

Instance Method Summary collapse

Methods inherited from Base

#diff_alpha, #initialize, #pixel_diff_score, #render_added_row, #render_changed_row, #render_deleted_row, #render_pixel, #render_unchanged_row

Constructor Details

This class inherits a constructor from Diffux::SnapshotComparisonImage::Base

Instance Method Details

#render_row(y, row) ⇒ Object



9
10
11
12
13
14
15
16
17
# File 'lib/diffux_core/snapshot_comparison_image/gutter.rb', line 9

def render_row(y, row)
  WIDTH.times do |x|
    render_pixel(x, y, gutter_color(row))
  end
  # render a two-pixel empty column
  2.times do |x|
    render_pixel(WIDTH - 1 - x, y, WHITE)
  end
end