EBoard 06: Transforming colors and images (Section 2)

Today’s start-of-class procedure

  • Take one of the business cards from OUTSIDE the jar.
  • Identify where the named computer is.
  • Drop the business card in the jar.
  • Navigate to that computer.
  • If you are first, log in, but do not start the lab.
  • When a second person arrives, introduce yourselves.

Warning! You are being recorded and transcribed, provided the technology is working correctly.

Approximate optimistic overview

  • Administrative stuff [5 min]
  • Questions [5 min]
  • Lab [50 min]
  • Turn in lab [5 min] (11:00)
  • Quiz [15 min]

Administrative stuff

Introductory notes

  • I’m going to try to keep intro stuff short so that you have more time for lab.
  • If you can’t make it to class, for whatever reason, please send me a note (email or Teams Message), preferably in advance of class. You need not explain why.
    • Missing class, no note: Two tokens charged.
    • Missing class, with note: No charge.
  • I tend to have a bimodal response rate for email and DMs: Either I respond quickly or I forget about the message and never respond. If I haven’t responded to your email or DM within 24 hours, feel free to send me a reminder.
  • Please read your comments for quizzes and such on Gradescope, even if you get credit for them. We try to provide useful feedback.

Upcoming activities

Scholarly

  • Tuesday, 11 February 2025, Noon–12:50 p.m., PDR 224C (White Dining Room). CS Table: ???
  • Thursday, 13 February 2025, 11:00 a.m.–Noon, JRC 101. Grinnell Lecture: Darrius Hills on “The Achievement of Identity: Soul Work, Salvation, and Black Manhood in the Religious Imagination of James Baldwin”.

Artistic

Multicultural

  • Friday, 7 February 2025, 4:00-5:00 p.m., HSSC N1170 (Global Living Room) Middle of Everywhere: How to Order a Coffee in Singapore.

Peer

Musical, theatric, sporting, and academic events involving this section’s students are welcome.

Wellness

  • Friday, 7 February 2025, 5:30–8:00 p.m., Downtown Grinnell. The Sweet Stroll.
  • Tuesday, 11 February 2025, 12:15–12:50 p.m., GCMoA. Yoga in the Museum.
  • Tuesday, 11 February 2025, 4:30–6:30 p.m., BRAC P103 (Multipurpose Dance Studio). Wellness Yoga.

Misc

  • Wednesday, 5 February 2025, Noon–12:45 p.m., Science 2021. Learn about the UIowa U2G (aka 4+1) program.
  • Thursday, 6 February 2025, 4:15–5:00 p.m., Herrick. Installation Ceremony for Endowed Professorships.
  • Sunday, 9 February 2025, 7:30–8:30pm, 3819. Mentor Session.
  • Tuesday, 11 February 2025, 7:00–8:00 p.m., Science 3820. Mentor Session.
  • Tuesday, 18 February 2025. 6:00–7:00 p.m., HSSC A1231. Make a Portfolio Website.

Other good things

These do not earn tokens, but are worth your consideration.

(none at the moment)

Upcoming work

Q&A

Administrative

Readings

Is the color swatch returned on calling (rgb ) an image, or some other kind of expression? If so, what is it?

It’s a color. Or a representation of a color.

Can we go over self-check 4?

Sure.

> (beside kitten
          (pixel-map rgb-purpler kitten))
.
> (beside kitten
          (pixel-map (o rgb-bluer rgb-redder) kitten))
.
> (beside kitten
          (pixel-map (o rgb-darker rgb-darker rgb-darker) kitten))
.
> (beside kitten
          (pixel-map rgb-darker kitten)
          (pixel-map (o rgb-darker rgb-darker rgb-darker) kitten))
.
> (define rgb-much-darker (o rgb-darker rgb-darker rgb-darker))
> (beside kitten
          (pixel-map rgb-much-darker kitten))
.
> (rgb-purpler "green")
. . rgb-red: contract violation
  expected: rgb?
  given: "green"

For self-check 4, how can we create a procedure that specifies colors by both the colors name and their RGB values?

That’s a great followup question. I believe there’s a color->rgb procedure that converts any form of color to an RGB color. So we could use something like (o rgb-redder rgb-bluer color->rgb).

MP2

Are there problems with outlined-polygon when coordinates are negative?

Yes. It’s on my list, but it will take a while to fix.

Lab

Please make sure to copy the code from the lab page into DrRacket.

Use a relatively small picture!

Consider creating a CSC151 folder for all your work.

When you submit: If you reference the images in your definitions pane, then you’ll need to upload those, too.

This is a lab in which I’d recommend that you read the rest somewhat carefully. You don’t need to figure out numbers, but you should understand the cuts and such.

Quiz

Drop it with the class mentor on the way out.