title: How can I define a color in Color.kt with simple way when I use Jetpack Compose?
body: <p>I can use Code A to define a color in Color.kt file which is generated by Android Studio wizard automatically, it's OK.</p>
  <p>I hope to define a color based <code>MaterialTheme.colors</code>, but Code B return the following error.</p>
  <p><em>@Composable invocations can only happen from the context of a @Composable function</em></p>
  <p>At present, I have to use Code C, it's not very good, is there a better way?</p>
  <p><strong>Code A</strong></p>
  <pre><code>val IconColor = Color(0xFF2E7D32)
  </code></pre>
  <p><strong>Code B</strong></p>
  <pre><code>val IconColor = MaterialTheme.colors.onSurface.copy(alpha = 0.76f)
  </code></pre>
  <p><strong>Code C</strong></p>
  <pre><code>@Composable
  fun IconColor(): Color {
      return MaterialTheme.colors.onSurface.copy(alpha = 0.76f)
  }
  </code></pre>