home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.alaska-software.com
/
2014.06.ftp.alaska-software.com.tar
/
ftp.alaska-software.com
/
acsn
/
ColourPadv1-0.txt
< prev
next >
Wrap
Text File
|
2003-10-22
|
2KB
|
64 lines
ColourPad.
----------
Requires Xbase++ versions that support PNG resource files.
ColourPad is a comprehensive Colour Control Function that enables
you to select, mix and match a very wide range of colours and get
some indication of what the colour combinations will look like.
It has two methods of returning the colours selected. The simplest
form is that the function returns the foreground and background
colours in an array. (Xbase++ colour format) The second method
is that it copies the colours to the clipboard in one of three
text formats ready for use, GRA, RGB or HTML.
e.g.
:SetColorFG( 17366790 )
:SetColorBG( 16777471 )
GraMakeRGBcolor({ 006, 255, 008 }) //...FG
GraMakeRGBcolor({ 255, 000, 000 }) //...BG
BGCOLOR="#FF0000" TEXT="#06FF08"
It also has a facility to copy any area of the background screen
and enable magnification of the image, and the ability to save the
image as Bmp, Gif, Jpg or Png. You can also use this feature to
determine the precise colours used in an image, the pixel colour
under the mouse pointer is displayed.
The dialog displays GRA, RGB, HTML and HSL values and you can change
the display text and size. Colours can be inverted and the background
colour switched with the foreground.
There is a reasonable Help file with the demo to describe these
features in more detail.
In keeping with most other projects I have placed in the public domain
this 'set' of functions has a lot of 'HowTo' tricks embeded as a matter
of course, even if you never have a need for a colour control there may
well be a few little tricks to whet your appetite.
To demonstrate its capabilities the function has been incorporated
in a simple demo and the demo code can be stripped out quite easily.
As always the code is released under the GNU General Public Licence
and is governed by the conditions and protocols setout therein, and is
Copyright (c) Greg J Doran. 2001-2003 GDO@eircom.net
Extract all files to a directory of your choice and execute:
Pbuild ColourPad
or click ColourPad.xpj to compile.
Note: If you run this as a function in an application you need to
disable the dialog from which it is called and enable it on return.
This is because the colourpad function has its own event loop.
Enjoy.