> For the complete documentation index, see [llms.txt](https://sryvkver.gitbook.io/cobi.bike/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://sryvkver.gitbook.io/cobi.bike/namespaces/app/is-dark.md).

# Is Dark

Reflects if it is dark outside.&#x20;

This is decided based on the time of the day. You may want to show a dark theme when it is dark to improve the user experience.

{% tabs %}
{% tab title="Typescript" %}

```typescript
const onIsDarkChange = (value: boolean, timestamp?: Date) => {
    console.log(value, timestamp);
};


COBI.app.isDark.read(onIsDarkChange); // Instantly get the current value
COBI.app.isDark.subscribe(onIsDarkChange);
COBI.app.isDark.unsubscribe(onIsDarkChange);
```

{% content-ref url="/pages/O3KsMM8kiH6KV3eK4qyS" %}
[Placemark](/cobi.bike/entities/placemark.md)
{% endcontent-ref %}
{% endtab %}

{% tab title="Javascript" %}

```javascript
const onIsDarkChange = (value, timestamp) => {
    console.log(value, timestamp);
};


COBI.app.isDark.read(onIsDarkChange); // Instantly get the current value
COBI.app.isDark.subscribe(onIsDarkChange);
COBI.app.isDark.unsubscribe(onIsDarkChange);
```

{% endtab %}
{% endtabs %}
