Sha256: a409565a819b2099f473be4c4900973359aa81cceb3119767a249f9a6e4cc974

Contents?: true

Size: 949 Bytes

Versions: 10

Compression:

Stored size: 949 Bytes

Contents

# Creating Colors (Homage to Albers). 
# 
# Creating variables for colors that may be referred to 
# in the program by their name, rather than a number. 


def setup
  size 640, 360
  redder = color 204, 102, 0
  yellower = color 204, 153, 0
  orangish = color 153, 51, 0
  
	# These statements are equivalent to the statements above.
	# Programmers may use the format they prefer.
	
	# redder = color '#CC6600'
	# yellower = color '#CC9900'
	# orangish = color '#993300'
	
	# or alternatively
	
	# redder = color 0xFFCC6600
	# yellower = color 0xFFCC9900
	# orangish = color 0xFF993300
	
	no_stroke
	background 51, 0, 0
	push_matrix
  translate 80, 80
  fill orangish
  rect 0, 0, 200, 200
  fill yellower
  rect 40, 60, 120, 120
  fill redder
  rect 60, 90, 80, 80
  pop_matrix
  
  push_matrix
  translate 360, 80
  fill redder
  rect 0, 0, 200, 200
  fill orangish
  rect 40, 60, 120, 120
  fill yellower
  rect 60, 90, 80, 80
  pop_matrix
end

Version data entries

10 entries across 10 versions & 1 rubygems

Version Path
ruby-processing-2.6.3 samples/processing_app/basics/color/creating.rb
ruby-processing-2.6.2 samples/processing_app/basics/color/creating.rb
ruby-processing-2.6.1 samples/processing_app/basics/color/creating.rb
ruby-processing-2.6.0 samples/processing_app/basics/color/creating.rb
ruby-processing-2.5.1 samples/processing_app/basics/color/creating.rb
ruby-processing-2.5.0 samples/processing_app/basics/color/creating.rb
ruby-processing-2.4.4 samples/processing_app/basics/color/creating.rb
ruby-processing-2.4.3 samples/processing_app/basics/color/creating.rb
ruby-processing-2.4.2 samples/processing_app/basics/color/creating.rb
ruby-processing-2.4.1 samples/processing_app/basics/color/creating.rb