-
Notifications
You must be signed in to change notification settings - Fork 1.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Added user-friendly support for commonly used colors #166
base: master
Are you sure you want to change the base?
Conversation
no additional functions were added to the library. the preset colors you can find in hexadecimal_colors_to_strings.h are now usable in the setPixelColor() function. colors are also color-coded in KEYWORD2 for enhanced user experience. example can be found in colors.ino in examples folder
great start! can you remove all changes to NeoPixel.cpp and .h? you dont need to include the colors header file there and cpp has some white space changes (which i'd like to not have in this PR!) |
deleted all whitespace modifications and .cpp file now matches the one in the original adafruit neopixel library
First of all, sorry for taking so long to get back to you. Secondly, I removed all changes to the Neopixel.h and .cpp files. However, when you remove the include reference to the hexadecimal_colors_to_strings.h in the .h file, colors.ino does not compile (reflected by the failed build) because TEAL, YELLOW, and MAROON are now not declared. I could put the library include for the hexadecimal_colors_to_strings.h file at the top of the example but that would kind of defeat the purpose of integrating it within the Adafruit Neopixel library. Let me know how you want me to move forward. |
I'd like to see these constants namespaced, either by prefixing them with
Because otherwise any user sketches with any of these names won't work anymore. I've seen a couple of LCD graphics libraries that have these same constants, and those sketches won't work anymore without modifying either library (or adding hundreds of |
I have the |
please ping when this compiles and passes travis CI |
You need to include "hexadecimal_to_string.h" header |
I've assembled a list of 140 preset colors so that instead of typing, for example,
theaterChase(strip.Color(20,34,16), delayval)
, users can typetheaterChase(TEAL, delayval)
. Both options for typing colors are available to users and the function will work either way. I've also put all 140 colors into thekeywords.txt
file and marked them asKEYWORD2
so users know it will be recognized as a valid color by Arduino. I've already written code and tested it on two separate LED ring models.I have changed the
Adafruit_Neopixel.h
file only by adding the#include "hexadecimal_colors_to_strings.h"
at the top. I have added a newhexadecimal_colors_to_strings.h
file in the directory as well. This file defines a list of 140 commonly used colors along with their hex values.On top of that, I added a new example file called
colors.ino
in which I demonstrate how these colors can be used.