You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
if color_name in colors:
robot.behavior.set_eye_color(colors[color_name])
print(f"Eye color set to {color_name}.")
else:
print("Invalid color name. Use 'red', 'blue', 'white', or 'pink'.")
def main():
# Prompt the user to choose a color
color = input("Enter a color (red, blue, white, pink): ").lower()
with anki_vector.Robot() as robot:
set_eye_color(robot, color)
if name == "main":
main()
The text was updated successfully, but these errors were encountered:
import anki_vector
from anki_vector.util import Color
def set_eye_color(robot: anki_vector.Robot, color_name: str):
# Define RGB values for the colors
colors = {
"red": Color(255, 0, 0),
"blue": Color(0, 0, 255),
"white": Color(255, 255, 255),
"pink": Color(255, 105, 180)
}
def main():
# Prompt the user to choose a color
color = input("Enter a color (red, blue, white, pink): ").lower()
if name == "main":
main()
The text was updated successfully, but these errors were encountered: