Class: Ra::Pixel

Inherits:
Object
  • Object
show all
Defined in:
lib/ra/pixel.rb

Overview

A pixel is a point in an image. It pairs the coordinates (x,y) with the color for that point.

Instance Attribute Summary collapse

Instance Method Summary collapse

Constructor Details

#initialize(x:, y:, color:) ⇒ Pixel

Returns a new instance of Pixel.

Parameters:



21
22
23
24
25
# File 'lib/ra/pixel.rb', line 21

def initialize(x:, y:, color:)
  @x = x
  @y = y
  @color = color
end

Instance Attribute Details

#colorRa::Color

Returns:



16
17
18
# File 'lib/ra/pixel.rb', line 16

def color
  @color
end

#xInteger

Returns:

  • (Integer)


8
9
10
# File 'lib/ra/pixel.rb', line 8

def x
  @x
end

#yInteger

Returns:

  • (Integer)


12
13
14
# File 'lib/ra/pixel.rb', line 12

def y
  @y
end