-
-
Notifications
You must be signed in to change notification settings - Fork 113
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
Improvement: Friendly Colorname (ColorInfo) #5
Comments
forget Color.cpp change on the zip |
corrected cache key from char* to string |
Ok, I will add them as constants in Colot.h rather than the string map. String lookup is slow and unneeded and strings take up unnecessary space. |
Added first color constants (see the commit 743f89c). |
My intention was to give tools and facilitate further integration. This called just on time on object creation - doesn't impact on animation speed. Please see Xlib on wikipedia |
Hi again
Please check my suggestion about having a friendly colorname.
I'm new to c++ and don't follow any convention/protocol so feel 100% free to adapt as you know best if you like this.
This was inspired by C# and MagikCore and overload of Color creation to add just the colorname instead of RGBA.
ColorInfo » Colornames to RGBA (outside Color to reduce memory footprint)
Color » overload to allow an easy Color("black"), Add a cache if too much called and an Exception if the color doesn't exist.
Thanks
Ricardo
ouzel.graphics.ColorInfo.zip
samples.zip
The text was updated successfully, but these errors were encountered: