ObjectArt

ObjectArt is a (currently incomplete) esoteric programming language. It appears as a rectangular image, where each pixel represents one piece of code, determined by its RGB values. It is object-oriented, and based largely on Java.
This language is currently in development. Suggestions, especially about keyword colors, are welcome.
==Design philosophy==
ObjectArt is designed to be as human-readable as possible. Different types of keywords have very different colors, and all variables of the same type have the same shape.
==Colors==
There are 16,777,216 possible colors, as the Red, Green, and Blue components can each range from 0 to 255.
The color has a special function, see #Program flow.
Colors where any of the Red, Green, or Blue components is equals to 128 represent keywords .The color is also a keyword.
Colors where the Red, Green, and Blue components are all less than 128 (the darkest octant) represent numbers.
Colors where the Red, Green, and Blue components are all greater than 128 (the brightest octant) represent Array inputs.
All other colors are used for variables.
==Segments==
An ObjectArt program consists of at least one segment, which serve as classes. To separate segments, a complete wall of "blank" () space is used, so each orthogonally connected group of non-blank space is a segment. Segments (or groups of segments) can also be placed in a separate file. All files used must be placed in the same folder, and must be explicitly imported.
==Classes==
Each class is represented by a group of pixels in a specific shape. To define a class, put it into its own segment. Note that its shape will be somewhat determined by its methods. A class with a large number of methods must be quite intricate, but even a simple class can be as complicated as you want. That is, there is a lower bound on shape complexity for a class, but no upper bound.
There are no static classes. When running the program, it creates an instance of the specified class, and runs its main method. (If the file run has multiple segments, then the one with a main method is run. There may be no more than one main method per file.)
==Program flow==
The program starts with the class with the main method, which touches the class on exactly one side. The program continues out the other side, always going in a straight line. If it encounters the edge of the image, or the color , it turns right.
==Keywords==
Remember that all keyword colors have at least one component equal to 128 (#80). In general, bluish colors are used for math, greenish colors for control flow, and reddish colors for miscellaneous stuff.
Keyword	Name 	Notes
 	nothing 	does nothing
 	plus 	number addition
 	minus 	binary operator
 	times 	multiplication
 	divided by 	7 / 2 = 3.5. 5 / 3 = 1.666... without limit.
 	modulus 	-10 mod 3 = 2. 10 mod -3 = 1. 6 mod 2.5 = 1. 8 mod 0 = 0.
 	and 	see #Boolean below; eager evaluation
 	or 	eager evaluation
 	not 	
 	bitwise and 	
 	bitwise or 	
 	bitwise xor 	
 	bitwise not 	
 	open-paren 	everything inside the parentheses is evaluated first
 	close-paren 	
 	start array 	
 	end array 	
 	assign to 	assigns the calculated value / object / array to the following variable
 	if( 	Next argument (until close-paren) is condition. If true, turn right at close-paren; if false, turn left.
 	for 	next argument is the array; the next is the name of the variable; from then until end is the body
 	end 	
 	done with parameters	used when invoking a method
 	class definition 	
 	entry point 	where to enter a class
 	main method 	must adjoin the class definition; one per file
 	other method 	must adjoin the class definition
 	return 	Returns next argument and ends method.
If next is blank or wall, returns 0 and ends.
 	constructor 	must adjoin the class definition; one per class
 	class variable 	must adjoin the class definition
 	output number 	
 	output character 	UTF-8 encoding; equivalent to ASCII for 0-127.
 	input number 	The input must be a number.
Input "100bottles" inputs 100, and leaves "bottles" for the next input. 
Input "bottles" inputs 0, and leaves "bottles". Input "" tries again.
 	input character 	Input "" tries again.
==Simple example==
This is a simple way of defining a class which outputs "Hello, world" when run.
The dark yellow block in the upper left is the class definition. The red square (just one pixel in the original) to its right is the main method, run at execution time. Each purple square means "output the following character", the blue squares are the ASCII values for the characters. Note how the the program turns right at each wall, and at the gray square at the left. The program ends at the grayish square in the middle.
Bear in mind that the white space is never read by the program. All of the white squares (except a few near the class definition) can be changed to any color at all without problems, although using white helps for clarity, and is the standard convention.
==Integers==
The only literals (class-less types) are integers, which are equivalent to booleans and character values (using UTF-8).
Standard integers are represented as 16384R + 128G + B, using the two's complement system to represent negatives. The largest integer normally representable is thus 1048575, and the smallest is -1048576.
Color	Decimal
 	0
 	1
 	100
 	10000
 	-1
 	-100
==Other numbers==
All numbers can exist in ObjectArt, including large numbers in both positive and negative, non-integers with unlimited precision, positive and negative infinity, and NaN. (Complex numbers may be added in a later version.) Many numbers not representable using the above method can be constructed in other ways. For example, 0.5 can be written as 1 / 2, negative infinity can be produced by -1 / 0, and 0 / 0 results in NaN.
However, there is no way to represent irrational numbers. Hence, any programming requiring a square-root function or Pi will have to make do with an approximation.
==Boolean==
Converting from numbers to Boolean, all numbers except 0 are considered true. From Boolean to numbers, true is -1 (); false is 0 ().
==Classes==
The essence of ObjectArt is classes. A program needs one class to run, but will typically make use of many other classes as well.
A class is defined as a shape. The shape can not be flipped or rotated. Typically, the main method's class is a three-by-three square, but any can be used. A class is defined by making its shape out of the color . Adjourning it must be an entry point and almost always a constructor. It will usually have methods, variables, and possibly a main method as well. Each of these components must touch the class on exactly one side.
To create an instance of a class, have the program flow lead into the entry point, draw the class (in any of the colors allocated for variables) and out the constructor. Then place any parameters, and finish with the done-with-parameters pixel. Voila! Your object is now created. To invoke it any time, go into the entry point of the object, and out one of the methods. Draw the parameters, and exit.
Category:2014
Category:Languages
Category:Non-textual
Category:Object-oriented paradigm
Category:Two-dimensional languages
Category:Unimplemented