# Function: compositionColor()

[**lifecycle-kit**](https://jonbogaty.com/lifecycle-kit/api/readme/index.md)

***

[lifecycle-kit](https://jonbogaty.com/lifecycle-kit/api/readme/index.md) / [chem](https://jonbogaty.com/lifecycle-kit/api/chem/readme/index.md) / compositionColor


# Function: compositionColor() {#function-compositioncolor}


> **compositionColor**(`c`, `backbone?`): `string`

Defined in: [chem/biomolecules.ts:180](https://github.com/jbcom/lifecycle-kit/blob/074e4e7b8038d3e2de9eb44c4b5b5aee0ef02b48/src/chem/biomolecules.ts#L180)

The colour a body takes on, blended from its tissues' elements.

Uses the CPK colours from the ported table, so a chitinous creature reads
carbon-dark and a mineral-rich one reads phosphorus-orange. The pixel a
player sees is downstream of what the creature is actually made of.

The backbone reaches the player here most visibly: carbon's CPK colour is
near-black, silicon's is a pale teal. A silicon-based creature looks
different because it IS different, not because anything recoloured it.


## Parameters {#parameters}



### c {#c}


[`Composition`](https://jonbogaty.com/lifecycle-kit/api/chem/type-aliases/composition/index.md)


### backbone? {#backbone}


[`Backbone`](https://jonbogaty.com/lifecycle-kit/api/chem/type-aliases/backbone/index.md) = `"C"`


## Returns {#returns}


`string`
