Why are some libraries red in Arduino IDE

As I asked above, I saw difference in the behaviour of these libraries
eg

#include <RtcDS3231.h>    // red text
#include <SparkFunTSL2561.h>   // black text

One behaviour is
the red one can’t be included inside a class, but the black once can

I was wondering if there is some reason to it.
Any effort is appreciated

The only meaning of the color is that the author of the RtcDS3231 library defined RtcDS3231 as a keyword and the author of the SparkFunTSL2561 did not define SparkFunTSL2561 as a keyword.

Library authors may define a list of keywords for their libraries in a file named keywords.txt. The Arduino IDE colors these keywords. Keywords are optional.

Some library authors define them.

Some library authors make an initial attempt to define them, then forget to keep the list updated so that the keyword list becomes incomplete as development on the library proceeds.

Some library authors attempt to define them, but don't bother to read the documentation on how to correctly format the keywords.txt file, so the keywords are not recognized by the Arduino IDE.

Some library authors don't bother to define keywords.

The Arduino IDE's keywords system is fairly crude in that it colors all keywords of every library you have installed, regardless of whether you are actually using that keyword in your code. So if you have a lot of libraries installed you'll find random words all through your code are colored for no good reason.

Keyword coloration is purely cosmetic. Don't put too much importance on the color of text in the Arduino IDE.

More information:

pert:
The only meaning of the color is that the author of the RtcDS3231 library defined RtcDS3231 as a keyword and the author of the SparkFunTSL2561 did not define SparkFunTSL2561 as a keyword.

Library authors may define a list of keywords for their libraries in a file named keywords.txt. The Arduino IDE colors these keywords. Keywords are optional.

Some library authors define them.

Some library authors make an initial attempt to define them, then forget to keep the list updated so that the keyword list becomes incomplete as development on the library proceeds.

Some library authors attempt to define them, but don't bother to read the documentation on how to correctly format the keywords.txt file, so the keywords are not recognized by the Arduino IDE.

Some library authors don't bother to define keywords.

The Arduino IDE's keywords system is fairly crude in that it colors all keywords of every library you have installed, regardless of whether you are actually using that keyword in your code. So if you have a lot of libraries installed you'll find random words all through your code are colored for no good reason.

Keyword coloration is purely cosmetic. Don't put too much importance on the color of text in the Arduino IDE.

More information:
Arduino IDE 1.5: Library specification · arduino/Arduino Wiki · GitHub

Wow, thanks for such a long reply
:slight_smile: