Skip to content

pip install anki_vector #228

@Readyornot69

Description

@Readyornot69

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)
}

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()

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions