Remove colour attributes from body and strip most of the font tags out

This commit is contained in:
James Gregory 2013-12-30 13:57:02 +11:00
commit c1f88ddb41
362 changed files with 1632 additions and 1706 deletions

View file

@ -24,7 +24,7 @@
<!--CHAPTER=55//-->
<!--PAGES=1031-1035//-->
<!--UNASSIGNED1//-->
<!--UNASSIGNED2//--></HEAD><BODY LINK=#0000FF ALINK=#000099 VLINK=#0000FF BGCOLOR=#FFFFFF>
<!--UNASSIGNED2//--></HEAD><body>
<CENTER>
<TABLE BORDER>
@ -36,9 +36,8 @@
</TABLE>
</CENTER>
<P><BR></P>
<H2><A NAME="Heading1"></A><FONT COLOR="#000077">Chapter 55<BR>Color Modeling in 256-Color Mode
</FONT></H2>
<H3><A NAME="Heading2"></A><FONT COLOR="#000077">Pondering X-Sharp&rsquo;s Color Model in an RGB State of Mind</FONT></H3>
<H2><A NAME="Heading1"></A>Chapter 55<BR>Color Modeling in 256-Color Mode</H2>
<H3><A NAME="Heading2"></A>Pondering X-Sharp&rsquo;s Color Model in an RGB State of Mind</H3>
<P>Once she turned six, my daughter wanted some fairly sophisticated books read to her<I>. Wind in the Willows.</I> <I>Little House on the Prairie.</I> Pretty heady stuff for one so young, and sometimes I wondered how much of it she really understood. As an experiment, during one reading I stopped whenever I came to a word I thought she might not know, and asked her what it meant. One such word was &ldquo;mulling.&rdquo;</P>
<P>&ldquo;Do you know what &lsquo;mulling&rsquo; means?&rdquo; I asked.</P>
<P>She thought about it for a while, then said, &ldquo;Pondering.&rdquo;</P>
@ -47,13 +46,13 @@
<P>&ldquo;Okay,&rdquo; I said, &ldquo;What does &lsquo;pondering&rsquo; mean?&rdquo;</P>
<P>&ldquo;Mulling,&rdquo; she said.</P>
<P>What does this anecdote tell us about the universe in which we live? Well, it certainly indicates that this universe is inhabited by at least one comedian and one good straight man. Beyond that, though, it can be construed as a parable about the difficulty of defining things properly; for example, consider the complications inherent in the definition of color on a 256-color display adapter such as the VGA. Coincidentally, VGA color modeling just happens to be this chapter&rsquo;s topic, and the place to start is with color modeling in general.</P>
<H4 ALIGN="LEFT"><A NAME="Heading3"></A><FONT COLOR="#000077">A Color Model</FONT></H4>
<H4 ALIGN="LEFT"><A NAME="Heading3"></A>A Color Model</H4>
<P>We&rsquo;ve been developing X-Sharp for several chapters now. In the previous chapter, we added illumination sources and shading; that addition makes it necessary for us to have a general-purpose color model, so that we can display the gradations of color intensity necessary to render illuminated surfaces properly. In other words, when a bright light is shining straight at a green surface, we need to be able to display bright green, and as that light dims or tilts to strike the surface at a shallower angle, we need to be able to display progressively dimmer shades of green.
</P>
<P>The first thing to do is to select a color model in which to perform our shading calculations. I&rsquo;ll use the dot product-based stuff I discussed in the previous chapter. The approach we&rsquo;ll take is to select an ideal representation of the full color space and do our calculations there, as if we really could display every possible color; only as a final step will we map each desired color into the limited 256-color set of the VGA, or the color range of whatever adapter we happen to be working with. There are a number of color models that we might choose to work with, but I&rsquo;m going to go with the one that&rsquo;s both most familiar and, in my opinion, simplest: RGB (red, green, blue).</P>
<P>In the RGB model, a given color is modeled as the mix of specific fractions of full intensities of each of the three color primaries. For example, the brightest possible pure blue is 0.0*R, 0.0*G, 1.0*B. Half-bright cyan is 0.0*R, 0.5*G, 0.5*B. Quarter-bright gray is 0.25*R, 0.25*G, 0.25*B. You can think of RGB color space as being a cube, as shown in Figure 55.1, with any particular color lying somewhere inside or on the cube.</P>
<P><A NAME="Fig1"><!-- </A><A HREF="javascript:displayWindow('images/55-01.jpg',406,192 )"> --><IMG SRC="images/55-01.jpg"><BR><!-- </A>
<BR><A HREF="javascript:displayWindow('images/55-01.jpg',406,192)"> --><FONT COLOR="#000077"><B>Figure 55.1</B></FONT></A>&nbsp;&nbsp;<I>The RGB color cube.</I>
<BR><A HREF="javascript:displayWindow('images/55-01.jpg',406,192)"> --><B>Figure 55.1</B></A>&nbsp;&nbsp;<I>The RGB color cube.</I>
</P>
<P>RGB is good for modeling colors generated by light sources, because red, green, and blue are the additive primaries; that is, all other colors can be generated by mixing red, green, and blue light sources. They&rsquo;re also the primaries for color computer displays, and the RGB model maps beautifully onto the display capabilities of 15- and 24-bpp display adapters, which tend to represent pixels as RGB combinations in display memory.
</P>
@ -86,7 +85,7 @@
<hr width="90%" size="1" noshade>
<div align="center">
<font face="Verdana,sans-serif" size="1">Graphics Programming Black Book &copy; 2001 Michael Abrash</font>
Graphics Programming Black Book &copy; 2001 Michael Abrash
</div>
<!-- all of the reference materials (books) have the footer and subfoot reveresed -->
<!-- reference_subfoot = footer -->