Help for Pickcolor
Posted: Fri Dec 05, 2014 12:52 pm
I made a small Pickcolor
But I not Know how return the color Rgb
it create a box with 48 colors
and with FLATBTN we can click on each color and it must return the rgb color of a colors array but there is something not run well
we can create it also with xbrowse...
But I not Know how return the color Rgb
it create a box with 48 colors
and with FLATBTN we can click on each color and it must return the rgb color of a colors array but there is something not run well
we can create it also with xbrowse...
- Code: Select all Expand view
#include "fivewin.ch"
#include "constant.ch"
Function test()
Local oDlgColor
Local nBottom := 12
Local nRight := 8
Local nWidth := Max( nRight * DLG_CHARPIX_W, 180 )
Local nHeight := nBottom * DLG_CHARPIX_H
local aColors := { rgb( 255, 127, 127), rgb( 255, 255, 127), rgb( 127, 255, 127),;
rgb( 0, 255, 127), rgb( 127, 255, 255), rgb( 0, 127, 255),;
rgb( 255, 127, 191), rgb( 255, 127, 255), rgb( 255, 0, 0),;
rgb( 255, 255, 0), rgb( 127, 255, 0), rgb( 0, 255, 63),;
rgb( 0, 255, 255), rgb( 0, 127, 191), rgb( 127, 127, 191),;
rgb( 255, 0, 255), rgb( 127, 63, 63), rgb( 255, 127, 63),;
rgb( 0, 255, 0), rgb( 0, 127, 127), rgb( 0, 63, 127),;
rgb( 127, 127, 255), rgb( 127, 0, 63), rgb( 255, 0, 127),;
rgb( 127, 0, 0), rgb( 255, 127, 0), rgb( 0, 127, 0),;
rgb( 0, 127, 63), rgb( 0, 0, 255), rgb( 0, 0, 159),;
rgb( 127, 0, 127), rgb( 127, 0, 255), rgb( 63, 0, 0),;
rgb( 127, 63, 0), rgb( 0, 63, 0), rgb( 0, 63, 63),;
rgb( 0, 0, 127), rgb( 0, 0, 63), rgb( 63, 0, 63),;
rgb( 63, 0, 127), rgb( 0, 0, 0), rgb( 127, 127, 0),;
rgb( 127, 127, 63), rgb( 127, 127, 127), rgb( 63, 127, 127),;
rgb( 191, 191, 191), rgb( 63, 0, 63), rgb( 255, 255, 255) }
Local aGetcolor[48]
Local nTop:= 1
Local nCol:= 1
DEFINE DIALOG oDlg ;
TITLE "Color Pick" ;
SIZE nWidth, nHeight TRANSPARENT PIXEL
k=0
For n=1 to 48
bAction := ColorReturn(n,aColors)
@ ntop,ncol FLATBTN aGetcolor[n] PROMPT "X" OF oDlg SIZE 8,8 COLOR aColors[n],aColors[n] ACTION bAction
k+=1
nCol+= 10
If k = 8
nCol:= 1
k:=0
nTop:= nTop+10
endif
next
ACTIVATE DIALOG oDlg
RETURN NIL
function ColorReturn(ncolor,aColors)
return { || msginfo( aColors[nColor]) }