Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial![](https://ecs-static.teamtreehouse.com/assets/views/marketing/shared/community-banner-white-47072046c51352fe6a69f5e691ff5700b28bb11d45197d7bdf066d9ea3f72d0c.webp)
![Thomas Katalenas](https://secure.gravatar.com/avatar/96f3985b2bd9cb398ef6e110a95b4834?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Thomas Katalenas
11,033 Pointswoha im lost
totally lost.
// Declare protocol here
protocol ColorSwitchable {
switchColor.Color(color)
}
enum LightState {
case On, Off
}
enum Color {
case RGB(Double, Double, Double, Double)
case HSB(Double, Double, Double, Double)
}
class WifiLamp {
let state: LightState
var color: Color
init() {
self.state = .On
self.color = .RGB(0,0,0,0)
}
}
1 Answer
![Chase Marchione](https://secure.gravatar.com/avatar/2b3a4eb00836bc9ba2829e89937cf5f4?s=96&d=https%3A%2F%2Fecs-static.teamtreehouse.com%2Fassets%2Fcontent%2Fdefault_avatar-445fbbabfc8dc9188fb5967fe43322ee0c3e0dd1e10f378bf8343784af5a13eb.webp&r=pg)
Chase Marchione
155,055 PointsHi Thomas,
According to the instructions, we need to create a a method named switchColor that takes a value of Color as an argument. Your current code looks as if you're trying to call switchColor, but we haven't defined that yet. So let's get the method declared, using the func keyword to define it.
For example, we might get rid of:
protocol ColorSwitchable {
switchColor.Color(color)
}
And replace it with:
protocol ColorSwitchable {
func switchColor(color: Color)
}
Hope this helps!