# Line color wrong - bug or feature?

**URL:** <https://forum.kirupa.com/t/line-color-wrong-bug-or-feature/303528>\
**Category:** Uncategorized\
**Created:** [January 21, 2010, 5:12pm UTC](https://forum.kirupa.com/t/line-color-wrong-bug-or-feature/303528 "2010-01-21T17:12:40Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![AndyZ](https://avatars.discourse-cdn.com/v4/letter/a/8dc957/32.png) [@AndyZ](https://forum.kirupa.com/u/AndyZ)\
**Post date:** [January 21, 2010, 5:12pm UTC](https://forum.kirupa.com/t/line-color-wrong-bug-or-feature/303528/1 "2010-01-21T17:12:40Z")

</div>

[LEFT][SIZE=2]So when I call lineTo() and then next call lineStyle() with a new color - that previous lineTo gets drawn in the new color, not whatever color was previously set. It is strange but I don’t know if there is some kind of justification for the behaviour?[/SIZE]  
[SIZE=2]Example: this is meant to draw 2 white lines but the second is drawn in blue if I do a blue lineStyle immediately after. Insert a moveTo or similar “end-draw” function then it’s ok. seems broken to me…:hangover:[/SIZE][/LEFT]

//EDIT: - put this rect draw bit first  
[SIZE=2][LEFT]graphics.beginFill(0x000000);[/LEFT]  
graphics.drawRect(0,0,50,50);  
[/SIZE]

[LEFT][SIZE=2]graphics.lineStyle(1, 0xFFFFFF);[/SIZE]  
[SIZE=2]graphics.moveTo(0,5);[/SIZE]  
[SIZE=2]graphics.lineTo(30,5);[/SIZE][/LEFT]

[LEFT][SIZE=2]graphics.lineStyle(1, 0xFFFFFF);[/SIZE]  
[SIZE=2]graphics.moveTo(0,15);[/SIZE]  
[SIZE=2]graphics.lineTo(30,15);[/SIZE][/LEFT]

[SIZE=2]//this next call sets color of previous lineTo!?[/SIZE]  
[SIZE=2]//if I insert a moveTo(x,y); then its ok (draws line before style change)[/SIZE]  
[SIZE=2]graphics.lineStyle(1, 0x0000FF);[/SIZE]

[SIZE=2](using flex builder and 3.2 SDK)[/SIZE]
