Hello Aron, I ran your code and it worked great. The center color widened and is more balanced along with the top and bottom colors. I'm working with the code now and would like to know how to manipulate the code to produce say a 5 color gradient, what would the other two color positions be called? In other words we have Top Color, Center Color and BottomColor. What would the parameters be for 5 color positions?
I'm realizing just how powerful this AFL code can be. Also, is this coding you sent me presented in the Amibroker 5.20 users guide or elsewhere on Amibroker's web site?. I'd like to learn to understand better what you coded and how to code these background colors. You have lots of interesting code here. I'm understanding how to manipulate the colors (somewhat). I can't place the RGB ( Yellow - 252,249,103) in your code. It wants either a single number (like violet - 38) or a color name (colorViolet). Then again perhaps I just don't understand how to manipulate it further to produce the custom RGB colors (as obtained in the color palette editor). Thanks for your kind help. --- In [email protected], Aron <[EMAIL PROTECTED]> wrote: > > electricwally77 wrote: > > Aron, Great job on the three color gradient. I have been playing with > > your code and can't seem to code the center color so it blends into > > the top and bottom (much like the top and bottom color blend). Right > > now, as the code is written, it shows the center color as more of a > > tighter range of blend than the top and bottom. > > > > In other words, the center color is more focused in on the center. I > > hope I am explaining this correctly. I certainly can live with the > > code the way it is written but if you have a way to "open" up the > > center color so it blends more like the top and bottom, I would > > appreciate the help. Thanks again. Wally > > > You can now widen the center , move it up and down > as well as control title, date an price axes colors: > > > |_SECTION_BEGIN("3 color gradient"); > > priceAxesWidth=68; > dateAxesHeight=17; > TitleHeight=17; > > pxwidth = Status("pxwidth"); > pxheight = Status("pxheight"); > > chartwidth = pxwidth-priceAxesWidth; > chartheight = pxheight-dateAxesHeight; > > topColor=ParamColor("topColor",*colorLightBlue*); > centerColor=ParamColor("centerColor", *colorWhite* ); > botColor=ParamColor("BottomColor", *colorLightBlue* ); > priceAxesColor=ParamColor("priceAxesColor", *colorWhite* ); > dateAxesColor=ParamColor("dateAxesColor", *colorWhite*); > > relPos=Param("centerPosition%",50,0,100,1)/100; > centerHeight=chartheight*Param("centerHeight%",10,0,100,1)/100; > x0=0; > y0=Max(TitleHeight,chartheight*relPos-centerHeight/2); > x1=chartwidth; > y1=Min(chartheight,chartheight*relPos+centerHeight/2); > > GfxSetBkMode( 1 ); > GfxSetOverlayMode(1); > GfxGradientRect(0,0,chartwidth,TitleHeight, *colorWhite* ,*colorWhite*); > GfxGradientRect(chartwidth,0,pxwidth,pxheight, priceAxesColor > ,priceAxesColor); > GfxGradientRect(0,chartheight,chartwidth,pxheight, dateAxesColor > ,dateAxesColor); > GfxGradientRect(x0,y0,x1,y1, CenterColor ,CenterColor ); > GfxGradientRect(0,TitleHeight,chartwidth, y0,topColor, CenterColor ); > GfxGradientRect(0,y1,chartwidth, chartheight, CenterColor ,botColor); > > _SECTION_END();| || >
