'I want to create a program (color related) in mac x.' is not very specific.
MacOS X comes with AppleScript, C/C++, Objective C, Java, Perl, Python, and Ruby. You will have to install the '/Developer/' folder via the MacOS X installation disc.
'FreePascal' can be obtained at 'http://www.freepascal.org/fpcmac.html'.
Apple's 'TextEdit' will save the 'add.c' file as 'add.c.rtf' (rich text format) by default. Even renaming the file as 'add.c', in 'Finder', will not help since 'gcc' will not properly compile it.
Use 'Tex-Edit Plus', 'BBEdit', 'XCode', or any text editor [do a 'www.versiontracker.com' search for 'text editor'] capable of saving the file in 'ASCII' format - to enter and save the provided sample C code to your 'Desktop'.
Enter 'gcc ~/Desktop/add.c -o ~/Desktop/add' and press <return>, to compile the code.
Enter '~/Desktop/add' and press <return>, to execute the resultant 'add' file.
Follow 'add's instructions.
To learn AppleScript through Ruby, do some respective 'Google' searches. You should find many tutorials, examples, and support web sites.