A Flash Developer Resource Site

Results 1 to 3 of 3

Thread: EXPERTS - beginGradientFill with brightness factor?

  1. #1
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472

    EXPERTS - beginGradientFill with brightness factor?

    hi guys

    I want do draw a 10 gradients based on a begincolor and a brightness factor ... but how?

    I have a variable containing a HEX value

    how do I get a variable 'endColor' to represent a slightly brightened version of 'beginColor'?

    Code:
    gradientHeight = menu._height/2;
    beginColor = "0x5B7CA7";
    //endColor = ??????
    gradientWidth = 200;
    for(i=1;i<11;i++) {
    	with (_root.menu["level" + i]) {
    	colors = [ beginColor, endColor];
    	alphas = [ 100, 100 ];
    	ratios = [ 0, 255 ];
    	matrix = { matrixType:"box", x:0, y:-gradientHeight, w:gradientWidth, h:gradientHeight, r:(90/180)*Math.PI };
    	beginGradientFill( "linear", colors, alphas, ratios, matrix );
    	moveto(0,-gradientHeight);
    	lineto(gradientWidth,-gradientHeight);
    	lineto(gradientWidth,0);
    	lineto(0,0);
    	lineto(0,-gradientHeight);
    	endFill();
    	}
    }
    help me ...

    Best regards
    //POD

  2. #2
    half as fun, double the price senocular's Avatar
    Join Date
    Feb 2002
    Location
    San Francisco, CA (USA)
    Posts
    4,358
    just use a brighter hex.

    one way of getting a brighter hex is opening your color mixer with your original color, then moving the brightnes slider up and down noting the new hexes provided.

  3. #3
    Bob (the singing sock)
    Join Date
    Aug 2000
    Location
    Århus, Denmark
    Posts
    472
    sure but I has to be done dynamicly.

    'beginColor' could contain any HEX-color.
    Otherwise it wouldn't be an EXPERT question

    //pod

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  




Click Here to Expand Forum to Full Width

HTML5 Development Center