Lab 2: RGB Color Formats for your Web Page


Part 1: Looking up tags

Knowing where to look up information about tags and attributes is important for several reasons. First, there are so many tags, attributes, and attribute values that it is impossible to know them all. Second, HTML is constantly changing so you need to constantly checking to see what is new. In this lab, I would like you to think of something that you don't know how to do, and to search around in our textbook and on the web for information that will help you. You do not need to do anything complicated. For example, try finding out the answer to to several of the following questions. Use your text and the reference on the web.

  1. How do you scale an image (i.e. make it larger, smaller, distorted, etc) in html?
  2. How do you change the color of the background or how do you set a background image?
  3. How do you create a numbered list of items?
  4. What are some tags that go in the header that change properties of the entire page?
  5. etc

Part 2: Decimal to Binary to Hexadecimal and Back

Practice converting from binary to decimal. For example, you should find that (try others as well)

  1. 00100010 (base 2) = 34 (base 10)
  2. 10000111 (base 2) = 135 (base 10)

Practice converting decimal to binary. Your resulting answer in binary format should have exactly 8 bits.

  1. For the numbers above covert back to the original binary.
  2. 115 (base 10) = 01110011 (base 2)
  3. 255 (base 10) = ??

Convert the binary numbers above to hexadecimal.

  1. Convert the number 255 to binary.
  2. Convert the number 255 from binary to hexadecimal.
  3. What is the hexadecimal representation for the color red=255, green=0, blue=0?
  4. Try using this color in your web page. Use the syntax #rrggbb.
  5. Go into the display properties and pick a color that you really like and would like to use in your web page. Convert this color to hex and place it in your web page.

To practice doing conversions, you can check your results using the java number conversion program.

Part 3: RGB Color Format

As discussed in class, color is often represented as 3 bytes (24 bits). Try the following



[top]

[Syllabus]

[Home]