//	COLORS.CPP (COLORS) - 256 color program.
//	COPYRIGHT (C) 1990-1995.  All Rights Reserved.
//	Zinc Software Incorporated.  Pleasant Grove, Utah  USA
//  May be freely copied, used and distributed.

#if !defined (ZIL_MSDOS)
	// Gray scale.
	const ZIL_COLOR PAL_16				= 0x00000000L;
	const ZIL_COLOR PAL_17  			= 0x00141414L;
	const ZIL_COLOR PAL_18	    		= 0x00202020L;
	const ZIL_COLOR PAL_19		    	= 0x002C2C2CL;
	const ZIL_COLOR PAL_20				= 0x00383838L;
	const ZIL_COLOR PAL_21		    	= 0x00454545L;
	const ZIL_COLOR PAL_22				= 0x00515151L;
	const ZIL_COLOR PAL_23				= 0x00616161L;
	const ZIL_COLOR PAL_24				= 0x00717171L;
	const ZIL_COLOR PAL_25				= 0x00828282L;
	const ZIL_COLOR PAL_26				= 0x00929292L;
	const ZIL_COLOR PAL_27				= 0x00A2A2A2L;
	const ZIL_COLOR PAL_28				= 0x00B6B6B6L;
	const ZIL_COLOR PAL_29				= 0x00CBCBCBL;
	const ZIL_COLOR PAL_30				= 0x00E3E3E3L;
	const ZIL_COLOR PAL_31				= 0x00FFFFFFL;

	// 24 color scale with nine variations of saturation and intensity.
	const ZIL_COLOR PAL_32				= 0x000000FFL;
	const ZIL_COLOR PAL_33				= 0x004100FFL;
	const ZIL_COLOR PAL_34				= 0x007D00FFL;
	const ZIL_COLOR PAL_35				= 0x00BE00FFL;
	const ZIL_COLOR PAL_36				= 0x00FF00FFL;
	const ZIL_COLOR PAL_37				= 0x00FF00BEL;
	const ZIL_COLOR PAL_38				= 0x00FF007DL;
	const ZIL_COLOR PAL_39				= 0x00FF0041L;
	const ZIL_COLOR PAL_40				= 0x00FF0000L;
	const ZIL_COLOR PAL_41				= 0x00FF4100L;
	const ZIL_COLOR PAL_42				= 0x00FF7D00L;
	const ZIL_COLOR PAL_43				= 0x00FFBE00L;
	const ZIL_COLOR PAL_44				= 0x00FFFF00L;
	const ZIL_COLOR PAL_45				= 0x00BEFF00L;
	const ZIL_COLOR PAL_46				= 0x007DFF00L;
	const ZIL_COLOR PAL_47				= 0x0041FF00L;
	const ZIL_COLOR PAL_48				= 0x0000FF00L;
	const ZIL_COLOR PAL_49				= 0x0000FF41L;
	const ZIL_COLOR PAL_50				= 0x0000FF7DL;
	const ZIL_COLOR PAL_51				= 0x0000FFBEL;
	const ZIL_COLOR PAL_52				= 0x0000FFFFL;
	const ZIL_COLOR PAL_53				= 0x0000BEFFL;
	const ZIL_COLOR PAL_54				= 0x00007DFFL;
	const ZIL_COLOR PAL_55				= 0x000041FFL;
	const ZIL_COLOR PAL_56				= 0x007D7DFFL;
	const ZIL_COLOR PAL_57				= 0x009E7DFFL;
	const ZIL_COLOR PAL_58				= 0x00BE7DFFL;
	const ZIL_COLOR PAL_59				= 0x00DF7DFFL;
	const ZIL_COLOR PAL_60				= 0x00FF7DFFL;
	const ZIL_COLOR PAL_61				= 0x00FF7DDFL;
	const ZIL_COLOR PAL_62				= 0x00FF7DBEL;
	const ZIL_COLOR PAL_63				= 0x00FF7D9EL;
	const ZIL_COLOR PAL_64				= 0x00FF7D7DL;
	const ZIL_COLOR PAL_65				= 0x00FF9E7DL;
	const ZIL_COLOR PAL_66				= 0x00FFBE7DL;
	const ZIL_COLOR PAL_67				= 0x00FFDF7DL;
	const ZIL_COLOR PAL_68				= 0x00FFFF7DL;
	const ZIL_COLOR PAL_69				= 0x00DFFF7DL;
	const ZIL_COLOR PAL_70				= 0x00BEFF7DL;
	const ZIL_COLOR PAL_71				= 0x009EFF7DL;
	const ZIL_COLOR PAL_72				= 0x007DFF7DL;
	const ZIL_COLOR PAL_73				= 0x007DFF9EL;
	const ZIL_COLOR PAL_74				= 0x007DFFBEL;
	const ZIL_COLOR PAL_75				= 0x007DFFDFL;
	const ZIL_COLOR PAL_76				= 0x007DFFFFL;
	const ZIL_COLOR PAL_77				= 0x007DDFFFL;
	const ZIL_COLOR PAL_78				= 0x007DBEFFL;
	const ZIL_COLOR PAL_79				= 0x007D9EFFL;
	const ZIL_COLOR PAL_80				= 0x00B6B6FFL;
	const ZIL_COLOR PAL_81				= 0x00C7B6FFL;
	const ZIL_COLOR PAL_82				= 0x00DBB6FFL;
	const ZIL_COLOR PAL_83				= 0x00EBB6FFL;
	const ZIL_COLOR PAL_84				= 0x00FFB6FFL;
	const ZIL_COLOR PAL_85				= 0x00FFB6EBL;
	const ZIL_COLOR PAL_86				= 0x00FFB6DBL;
	const ZIL_COLOR PAL_87				= 0x00FFB6C7L;
	const ZIL_COLOR PAL_88				= 0x00FFB6B6L;
	const ZIL_COLOR PAL_89				= 0x00FFC7B6L;
	const ZIL_COLOR PAL_90				= 0x00FFDBB6L;
	const ZIL_COLOR PAL_91				= 0x00FFEBB6L;
	const ZIL_COLOR PAL_92				= 0x00FFFFB6L;
	const ZIL_COLOR PAL_93				= 0x00EBFFB6L;
	const ZIL_COLOR PAL_94				= 0x00DBFFB6L;
	const ZIL_COLOR PAL_95				= 0x00C7FFB6L;
	const ZIL_COLOR PAL_96				= 0x00B6DFB6L;
	const ZIL_COLOR PAL_97				= 0x00B6FFC7L;
	const ZIL_COLOR PAL_98				= 0x00B6FFDBL;
	const ZIL_COLOR PAL_99				= 0x00B6FFEBL;
	const ZIL_COLOR PAL_100				= 0x00B6FFFFL;
	const ZIL_COLOR PAL_101				= 0x00B6EBFFL;
	const ZIL_COLOR PAL_102				= 0x00B6DBFFL;
	const ZIL_COLOR PAL_103				= 0x00B6C7FFL;
	const ZIL_COLOR PAL_104				= 0x00000071L;
	const ZIL_COLOR PAL_105				= 0x001C0071L;
	const ZIL_COLOR PAL_106				= 0x00380071L;
	const ZIL_COLOR PAL_107				= 0x00550071L;
	const ZIL_COLOR PAL_108				= 0x00710071L;
	const ZIL_COLOR PAL_109				= 0x00710055L;
	const ZIL_COLOR PAL_110				= 0x00710038L;
	const ZIL_COLOR PAL_111				= 0x0071001CL;
	const ZIL_COLOR PAL_112				= 0x00710000L;
	const ZIL_COLOR PAL_113				= 0x00711C00L;
	const ZIL_COLOR PAL_114				= 0x00713800L;
	const ZIL_COLOR PAL_115				= 0x00715500L;
	const ZIL_COLOR PAL_116				= 0x00717100L;
	const ZIL_COLOR PAL_117				= 0x00557100L;
	const ZIL_COLOR PAL_118				= 0x00387100L;
	const ZIL_COLOR PAL_119				= 0x001C7100L;
	const ZIL_COLOR PAL_120				= 0x00007100L;
	const ZIL_COLOR PAL_121				= 0x0000711CL;
	const ZIL_COLOR PAL_122				= 0x00007138L;
	const ZIL_COLOR PAL_123				= 0x00007155L;
	const ZIL_COLOR PAL_124				= 0x00007171L;
	const ZIL_COLOR PAL_125				= 0x00005571L;
	const ZIL_COLOR PAL_126				= 0x00003871L;
	const ZIL_COLOR PAL_127				= 0x00001C71L;
	const ZIL_COLOR PAL_128				= 0x00383871L;
	const ZIL_COLOR PAL_129				= 0x00453871L;
	const ZIL_COLOR PAL_130				= 0x00553871L;
	const ZIL_COLOR PAL_131				= 0x00613871L;
	const ZIL_COLOR PAL_132				= 0x00713871L;
	const ZIL_COLOR PAL_133				= 0x00713861L;
	const ZIL_COLOR PAL_134				= 0x00713855L;
	const ZIL_COLOR PAL_135				= 0x00713845L;
	const ZIL_COLOR PAL_136				= 0x00713838L;
	const ZIL_COLOR PAL_137				= 0x00714538L;
	const ZIL_COLOR PAL_138				= 0x00715538L;
	const ZIL_COLOR PAL_139				= 0x00716138L;
	const ZIL_COLOR PAL_140				= 0x00717138L;
	const ZIL_COLOR PAL_141				= 0x00617138L;
	const ZIL_COLOR PAL_142				= 0x00557138L;
	const ZIL_COLOR PAL_143				= 0x00457138L;
	const ZIL_COLOR PAL_144				= 0x00387138L;
	const ZIL_COLOR PAL_145				= 0x00387145L;
	const ZIL_COLOR PAL_146				= 0x00387155L;
	const ZIL_COLOR PAL_147				= 0x00387161L;
	const ZIL_COLOR PAL_148				= 0x00387171L;
	const ZIL_COLOR PAL_149				= 0x00386171L;
	const ZIL_COLOR PAL_150				= 0x00385571L;
	const ZIL_COLOR PAL_151				= 0x00384571L;
	const ZIL_COLOR PAL_152				= 0x00515171L;
	const ZIL_COLOR PAL_153				= 0x00595171L;
	const ZIL_COLOR PAL_154				= 0x00615171L;
	const ZIL_COLOR PAL_155				= 0x00695171L;
	const ZIL_COLOR PAL_156				= 0x00715171L;
	const ZIL_COLOR PAL_157				= 0x00715169L;
	const ZIL_COLOR PAL_158				= 0x00715161L;
	const ZIL_COLOR PAL_159				= 0x00715159L;
	const ZIL_COLOR PAL_160				= 0x00715151L;
	const ZIL_COLOR PAL_161				= 0x00715951L;
	const ZIL_COLOR PAL_162				= 0x00716151L;
	const ZIL_COLOR PAL_163				= 0x00716951L;
	const ZIL_COLOR PAL_164				= 0x00717151L;
	const ZIL_COLOR PAL_165				= 0x00697151L;
	const ZIL_COLOR PAL_166				= 0x00617151L;
	const ZIL_COLOR PAL_167				= 0x00597151L;
	const ZIL_COLOR PAL_168				= 0x00517151L;
	const ZIL_COLOR PAL_169				= 0x00517159L;
	const ZIL_COLOR PAL_170				= 0x00517161L;
	const ZIL_COLOR PAL_171				= 0x00517169L;
	const ZIL_COLOR PAL_172				= 0x00517171L;
	const ZIL_COLOR PAL_173				= 0x00516971L;
	const ZIL_COLOR PAL_174				= 0x00516171L;
	const ZIL_COLOR PAL_175				= 0x00515971L;
	const ZIL_COLOR PAL_176				= 0x00000041L;
	const ZIL_COLOR PAL_177				= 0x00100041L;
	const ZIL_COLOR PAL_178				= 0x00200041L;
	const ZIL_COLOR PAL_179				= 0x00300041L;
	const ZIL_COLOR PAL_180				= 0x00410041L;
	const ZIL_COLOR PAL_181				= 0x00410030L;
	const ZIL_COLOR PAL_182				= 0x00410020L;
	const ZIL_COLOR PAL_183				= 0x00410010L;
	const ZIL_COLOR PAL_184				= 0x00410000L;
	const ZIL_COLOR PAL_185				= 0x00411000L;
	const ZIL_COLOR PAL_186				= 0x00412000L;
	const ZIL_COLOR PAL_187				= 0x00413000L;
	const ZIL_COLOR PAL_188				= 0x00414100L;
	const ZIL_COLOR PAL_189				= 0x00304100L;
	const ZIL_COLOR PAL_190				= 0x00204100L;
	const ZIL_COLOR PAL_191				= 0x00104100L;
	const ZIL_COLOR PAL_192				= 0x00004100L;
	const ZIL_COLOR PAL_193				= 0x00004110L;
	const ZIL_COLOR PAL_194				= 0x00004120L;
	const ZIL_COLOR PAL_195				= 0x00004130L;
	const ZIL_COLOR PAL_196				= 0x00004141L;
	const ZIL_COLOR PAL_197				= 0x00003041L;
	const ZIL_COLOR PAL_198				= 0x00002041L;
	const ZIL_COLOR PAL_199				= 0x00001041L;
	const ZIL_COLOR PAL_200				= 0x00202041L;
	const ZIL_COLOR PAL_201				= 0x00282041L;
	const ZIL_COLOR PAL_202				= 0x00302041L;
	const ZIL_COLOR PAL_203				= 0x00382041L;
	const ZIL_COLOR PAL_204				= 0x00412041L;
	const ZIL_COLOR PAL_205				= 0x00412038L;
	const ZIL_COLOR PAL_206				= 0x00412030L;
	const ZIL_COLOR PAL_207				= 0x00412028L;
	const ZIL_COLOR PAL_208				= 0x00412020L;
	const ZIL_COLOR PAL_209				= 0x00412820L;
	const ZIL_COLOR PAL_210				= 0x00413020L;
	const ZIL_COLOR PAL_211				= 0x00413820L;
	const ZIL_COLOR PAL_212				= 0x00414120L;
	const ZIL_COLOR PAL_213				= 0x00384120L;
	const ZIL_COLOR PAL_214				= 0x00304120L;
	const ZIL_COLOR PAL_215				= 0x00284120L;
	const ZIL_COLOR PAL_216				= 0x00204120L;
	const ZIL_COLOR PAL_217				= 0x00204128L;
	const ZIL_COLOR PAL_218				= 0x00204130L;
	const ZIL_COLOR PAL_219				= 0x00204138L;
	const ZIL_COLOR PAL_220				= 0x00204141L;
	const ZIL_COLOR PAL_221				= 0x00203841L;
	const ZIL_COLOR PAL_222				= 0x00203041L;
	const ZIL_COLOR PAL_223				= 0x00202841L;
	const ZIL_COLOR PAL_224				= 0x002C2C41L;
	const ZIL_COLOR PAL_225				= 0x00302C41L;
	const ZIL_COLOR PAL_226				= 0x00342C41L;
	const ZIL_COLOR PAL_227				= 0x003C2C41L;
	const ZIL_COLOR PAL_228				= 0x00412C41L;
	const ZIL_COLOR PAL_229				= 0x00412C3CL;
	const ZIL_COLOR PAL_230				= 0x00412C34L;
	const ZIL_COLOR PAL_231				= 0x00412C30L;
	const ZIL_COLOR PAL_232				= 0x00412C2CL;
	const ZIL_COLOR PAL_233				= 0x0041302CL;
	const ZIL_COLOR PAL_234				= 0x0041342CL;
	const ZIL_COLOR PAL_235				= 0x00413C2CL;
	const ZIL_COLOR PAL_236				= 0x0041412CL;
	const ZIL_COLOR PAL_237				= 0x003C412CL;
	const ZIL_COLOR PAL_238				= 0x0034412CL;
	const ZIL_COLOR PAL_239				= 0x0030412CL;
	const ZIL_COLOR PAL_240				= 0x002C412CL;
	const ZIL_COLOR PAL_241				= 0x002C4130L;
	const ZIL_COLOR PAL_242				= 0x002C4134L;
	const ZIL_COLOR PAL_243				= 0x002C413CL;
	const ZIL_COLOR PAL_244				= 0x002C4141L;
	const ZIL_COLOR PAL_245				= 0x002C3C41L;
	const ZIL_COLOR PAL_246				= 0x002C3441L;
	const ZIL_COLOR PAL_247				= 0x002C3041L;

	// Last eight palettes are not used and are thus set to zero.
	const ZIL_COLOR PAL_248				= 0x00000000L;
	const ZIL_COLOR PAL_249				= 0x00000000L;
	const ZIL_COLOR PAL_250				= 0x00000000L;
	const ZIL_COLOR PAL_251				= 0x00000000L;
	const ZIL_COLOR PAL_252				= 0x00000000L;
	const ZIL_COLOR PAL_253				= 0x00000000L;
	const ZIL_COLOR PAL_254				= 0x00000000L;
	const ZIL_COLOR PAL_255				= 0x00000000L;
#endif

class ZIL_EXPORT_CLASS COLORS_WINDOW : public UIW_WINDOW
{
public:
	COLORS_WINDOW(void);
	virtual ~COLORS_WINDOW(void) { };
	virtual EVENT_TYPE DrawItem(const UI_EVENT &event, EVENT_TYPE ccode);
	void RGBConvert(int colorIndex, UI_PALETTE &palette);

#if !defined(ZIL_MSDOS)
	ZIL_COLOR *colorTable;
#endif		
};
