# Locations of code related to book titles

**URL:** <https://discourse.cataclysmdda.org/t/locations-of-code-related-to-book-titles/6439>\
**Category:** The Drawing Board\
**Created:** [June 9, 2014, 5:02am UTC](https://discourse.cataclysmdda.org/t/locations-of-code-related-to-book-titles/6439 "2014-06-09T05:02:25Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![nothign](https://avatars.discourse-cdn.com/v4/letter/n/f08c70/32.png) [@nothign](https://discourse.cataclysmdda.org/u/nothign)\
**Post date:** [June 9, 2014, 5:02am UTC](https://discourse.cataclysmdda.org/t/locations-of-code-related-to-book-titles/6439/1 "2014-06-09T05:02:25Z")

</div>

First let me say that I’ve been playing the game for about two weeks straight and I absolutely love it. I feel like it was made for me.

Note: I’m playing experimental build version: 6def3c2

I’m planning on making a small contribution and was wondering if anybody knows where the code that manages the changing color of a books title is.  
Book titles seem to changed color from blue to yellow based on their required intelligence, and required skill level to understand compared to your current intelligence and skill level. I’m looking for the location of the function(s) that handle that.

If somebody could point me in that direction I can save myself some time spent hunting!

Thanks guys!

---

<div class="post-metadata">

**Author:** ![kevin.granade](https://sea2.discourse-cdn.com/flex016/user_avatar/discourse.cataclysmdda.org/kevin.granade/32/1316_2.png) [@kevin.granade](https://discourse.cataclysmdda.org/u/kevin.granade)\
**Post date:** [June 9, 2014, 6:05am UTC](https://discourse.cataclysmdda.org/t/locations-of-code-related-to-book-titles/6439/2 "2014-06-09T06:05:03Z")

</div>

Item info is defined in data/json/items/, books in particular are in that directory in books.json  
The code that loads those files is in src/item\_factory.cpp, specifically load\_book()  
The data structure for book definitions is in src/itype.h, it’s called it\_book  
Item names are generated in item.cpp in item::tname()  
item descriptions are in a big hairball in item.cpp in item::info()  
colors in particular are decided in item::color() \<— I think this is what you’re looking for  
Note book handling is in a bit of flux, this just landed: [https://github.com/CleverRaven/Cataclysm-DDA/pull/7814](https://github.com/CleverRaven/Cataclysm-DDA/pull/7814)
