HTML and CSS Reference
In-Depth Information
context.fillText (message, xPosition,yPosition);
case "stroke":
context.strokeStyle = textFillColor;
context.strokeText (message, xPosition,yPosition);
case "both":
context.fillStyle = textFillColor;
context.fillText (message, xPosition ,yPosition);
context.strokeStyle = "#000000";
context.strokeText (message, xPosition,yPosition);
Notice that we needed to update the switch() statement created for Text Arranger
version 1.0 so that it used textFillColor instead of hardcoded values. However, when
both a stroke and a fill are chosen, we still render the stroke as black (“#000000”). We
could have added an additional color picker for the strokeColor , but that is something
you can do if you want to start expanding the application. Figure 3-5 illustrates what
it looks like now.
Figure 3-5. Setting the font color
Search WWH ::

Custom Search