@@ -7,40 +7,40 @@ A Python package to interact with the CheerLights API. It allows users to get th
77You can install the package using pip:
88
99``` bash
10- pip install cheerlights-api
10+ pip install cheerlights_api
1111```
1212
1313## Usage Examples
1414
1515``` python
16- import cheerlights - api
16+ import cheerlights_api
1717
1818# Get the current color name and hex code
19- current_color = cheerlights .get_current_color()
19+ current_color = cheerlights_api .get_current_color()
2020print (current_color) # Example: {'color': 'red', 'hex': '#FF0000'}
2121
2222# Get the current color name
23- color_name = cheerlights .get_current_color_name()
23+ color_name = cheerlights_api .get_current_color_name()
2424print (color_name) # Example: 'red'
2525
2626# Get the current hex code
27- hex_code = cheerlights .get_current_hex()
27+ hex_code = cheerlights_api .get_current_hex()
2828print (hex_code) # Example: '#FF0000'
2929
3030# Get the history of colors
31- history = cheerlights .get_color_history(5 )
31+ history = cheerlights_api .get_color_history(5 )
3232for entry in history:
3333 print (f " { entry[' timestamp' ]} : { entry[' color' ]} ( { entry[' hex' ]} ) " )
3434
3535# Convert a color name to hex
36- hex_code = cheerlights .color_name_to_hex(' green' )
36+ hex_code = cheerlights_api .color_name_to_hex(' green' )
3737print (hex_code) # '#00FF00'
3838
3939# Convert hex code to RGB
40- rgb = cheerlights .hex_to_rgb(' #00FF00' )
40+ rgb = cheerlights_api .hex_to_rgb(' #00FF00' )
4141print (rgb) # (0, 255, 0)
4242
4343# Check if a color is valid
44- is_valid = cheerlights .is_valid_color(' purple' )
44+ is_valid = cheerlights_api .is_valid_color(' purple' )
4545print (is_valid) # True
4646```
0 commit comments