---
title: "toColorLong"
description: "Converts the Color to a 64-bit [ColorLong] value that can be used by Android's framework.
[Color.value] isn't fully compatible with Android's 64-bit [ColorLong] values as some color
spaces differ, so this method handles the conversion."
type: "function"
---

<div class='type'>Function</div>


<a id='references'></a>
<div class='sourceset sourceset-android'>Android</div>


```kotlin
@ColorLong
fun Color.toColorLong(): Long
```


Converts the Color to a 64-bit `ColorLong` value that can be used by Android's framework.
`Color.value` isn't fully compatible with Android's 64-bit `ColorLong` values as some color
spaces differ, so this method handles the conversion.



