Homework Hack
In your notebook, explain the following, along with one application to YOUR work: – What is a hex color code? What are some examples? A hex color code is a six-digit hexadecimal representation of colors using red, green, and blue values. It is used in web design and programming to precisely define colors for visual elements. Some example of hex color codes being used are styling in text, divs, anywhere color is used on a website.
– What is Base64 and how is it used with images? Base64 is a method of encoding binary data (like image files) into a plain-text format. It is used with images to embed them directly into HTML or documents without needing separate file references.
– Why might you use Base64 instead of a regular image file? Base64 is used instead of regular image files to embed images directly into code, HTML, or notebooks for portability and convenience. This is useful when sharing or saving work in a single file without broken image links.
Then, Insert an image into your Jupyter notebook and explain how it’s stored and displayed.
The code uses HTML to display an image by linking to its file path on the server, using Jekyll’s /Elliot_2025 to ensure the path works correctly. This is common in static websites like those built with GitHub Pages. Unlike Base64, which embeds the image data directly into the page, this method relies on an external file. Base64 is more portable and self-contained, while file references like this keep HTML cleaner and reduce page size.