[futurebasic] Color picker

Message: < previous - next > : Reply : Subscribe : Cleanse
Home   : September 2008 : Group Archive : Group : All Groups

From: "Pierre Zippi" <pierrezippi@...>
Date: Mon, 29 Sep 2008 17:18:07 -0500
This code used to work in FBII and half works in FB4. I suspect it is
in the way the vars are dimmed, but what do I know? I've been brute
force trial and erroring and now it's time to ask the list.

CLEAR LOCAL
DIM Ypt,Xpt,32 Prompt$
DIM RGB.6
DIM RGBin.6
LOCAL FN getLongColor
  Ypt=0 : Xpt=0
  RGBin.red%=red&            'current color in
  RGBin.green%=green&
  RGBin.blue%=blue&
  Prompt$="Select a color
  result%=FN GETCOLOR(Ypt,Prompt$,RGBin,VARPTR(RGB))
  LONG IF result%<>0
    red&=VAL(UNS$(RGB.red%))
    green&=VAL(UNS$(RGB.green%))
    blue&=VAL(UNS$(RGB.blue%))
    ColorSets&(CurDataSet%,1)=red&
    ColorSets&(CurDataSet%,2)=green&
    ColorSets&(CurDataSet%,3)=blue&
  XELSE
    'canceled
  END IF
END FN