ofSetColor(ofColor::purple) and ofSetColor(ofColor::beige) don't work

Hey.

  
  
ofSetColor(ofColor::purple)  
  

gives me a bunch of errors.

The build log is in Japanese but I think you can figure out what they mean by the erroe codes.
Here are they:

[tt]
1>------ ???: ???: bio_demo, ??: Debug Win32 ------
1> testApp.cpp
1>c:\users\greekfellows\documents\of_v0.7.4_vs2010_release\of_v0.7.4_vs2010_release\libs\openframeworks\types\ofcolor.h(182): warning C4244: ‘=’ : ‘float’ ?? ‘unsigned char’ ???
1> c:\users\greekfellows\documents\of_v0.7.4_vs2010_release\of_v0.7.4_vs2010_release\libs\openframeworks\types\ofcolor.h(162) : ??? ??? ??? ‘void ofColor_::copyFrom(const ofColor_ &)’ ???
1> with
1> [
1> PixelType=unsigned char
1> ]
1> c:\users\greekfellows\documents\of_v0.7.4_vs2010_release\of_v0.7.4_vs2010_release\apps\myapps\bio_demo\src\testapp.cpp(221) : ??? ??? ??? ‘ofColor_::ofColor_(const ofColor_ &)’ ???
1> with
1> [
1> PixelType=unsigned char
1> ]
1>c:\users\greekfellows\documents\of_v0.7.4_vs2010_release\of_v0.7.4_vs2010_release\libs\openframeworks\types\ofcolor.h(187): warning C4244: ‘=’ : ‘const float’ ?? ‘unsigned char’ ???
1>main.obj : warning LNK4075: /EDITANDCONTINUE ? /INCREMENTAL:NO ???
1> ??? bin\bio_demo_debug.lib ??? bin\bio_demo_debug.exp ???
1>MSVCRTD.lib(cinitexe.obj) : warning LNK4098: defaultlib ‘msvcrt.lib’ ???/NODEFAULTLIB:library ???
1>testApp.obj : error LNK2019: ??? “public: void __thiscall testApp::drawCuboid(float,float,float,float,float,float)” (?drawCuboid@testApp@@QAEXMMMMMM@Z) ??? “public: virtual void __thiscall testApp::draw(void)” (?draw@testApp@@UAEXXZ) ???
1>bin\bio_demo_debug.exe : fatal error LNK1120: ??? 1 ???
========== ???: 0 ???1 ???1 ???0 ??? ==========
[/tt]

Thanks!

ofColor class has specific color members only for very commonly used colors such as white, gray, black, red, green, blue, cyan, magenta, yellow and not for all the colors.

Purple and Beige are not included in the above colors and it’s always better to set a color using the color codes (RGB or HSB). You can use ofSetColor(r,g,b) to set the color where r, g and b are will be the code for any of your color.
You can also opt to use ofColor::fromHex(hexColor, alpha = limit()) or ofColor::fromHsb(hue, saturation, brightness, alpha = limit()) convenience methods to construct an ofColor

sorry, but this is not true, a load of colors have been added with 0.7.4.: https://github.com/openframeworks/openFrameworks/blob/master/libs/openFrameworks/types/ofColor.h#L30-L48

@bilderbuchi : Thanks for pointing out. I didn’t notice that the OP had 0.7.4 in the error. I am still on of_v0073 and I checked the ofColor class implementation which only had a few colors which I wrote above.

@OP: I downloaded the new 0.7.4 osx release and tried setting Purple and Beige colors using ofSetColor(ofColor::purple); and it worked fine for me. If your issue still persists, please post back with code to replicate this.

@harpreet
Thanks for your reply! I’m sorry I didn’t mention that I’m using [tt]v0.7.4[/tt].
Now it works fine, miraculously.
Once I cleaned and built the solution over, it didn’t show any errors.