Colors
Ajay Gandecha
UNC Department of Computer Science
COMP 426: Modern Web Programming (Spring 2025)
Module 5: Design
Lecture 24
Announcements
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
!
!
Recall: Principles of Design
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Colors
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Anatomy of a Color
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Anatomy of a Color
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Hue
Anatomy of a Color
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Saturation
Anatomy of a Color
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Brightness
Color Representations
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
rgb(160,120,140) Values range from 0-255
#3F89CC Values range from 0-FF (0-255 in hexadecimal)
hsl(160,100% ,50%) Hue values range from 0-360 (degree on color wheel)� Saturation + brightness values range from 0-100%.
Another Value: Alpha
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
rgba(160,120,140,0.5) Alpha value ranges from 0-100%.
#3F89CC3C Alpha value ranges from 0-FF.
hsl(160,100%,50%,0.5) Alpha value ranges from 0.0-1.0.
Creating a Color Palette
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Creating a Color Palette
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Creating a Color Palette
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Save Changes
Cancel
Creates a hierarchy of importance / “weight” of action.
The “Save Changes” button performs a mutating action, the “Cancel” button does not.
Look! These animated pop ups have different prominence levels...
60-30-10 Rule
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Primary
Accent
Secondary
Colors
COMP 426: Modern Web Programming (Spring ‘25)
Your Turn!
!
M5: Design
L24
Generating a Color Palette
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Pitfalls!
COMP 426: Modern Web Programming (Spring ‘25)
Colors
Or something like this…
M5: Design
L24
Pitfalls!
COMP 426: Modern Web Programming (Spring ‘25)
Colors
… especially on top of each other! X _ x
M5: Design
L24
Pitfalls!
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Dark Mode
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Dark Mode
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Material Design
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Color Palettes for Shadcn
COMP 426: Modern Web Programming (Spring ‘25)
Colors
M5: Design
L24
Colors
COMP 426: Modern Web Programming (Spring ‘25)
Your Turn!
!
M5: Design
L24