This is a standard naming convention in Jetpack Compose, and is described in the API Guidelines. It's used throughout the framework and libraries, and can optionally be followed by app developers too.
Jetpack Compose framework development MUST name deeply immutable constants following the permitted object declaration convention of PascalCase as documented here as a replacement for any usage of CAPITALS_AND_UNDERSCORES. Enum class values MUST also be named using PascalCase as documented in the same section.
Library development SHOULD follow this same convention when targeting or extending Jetpack Compose.
App Development MAY follow this convention.
https://android.googlesource.com/platform/frameworks/support/+/androidx-main/compose/docs/compose-api-guidelines.md#singletons_constants_sealed-class-and-enum-class-values
In the same document they provide some justification for the decision, if you're interested in reading more. The source they're referencing there is the Kotlin coding conventions, which actually give a bit of leeway on whether property names should start with an uppercase letter. It's not as simple as "all variables are lowerCamelCase".
What the Kotlin style guide says is:
Names of top-level or object properties which hold objects with behavior or mutable data should use camel case names:
val mutableCollection: MutableSet<String> = HashSet()
Names of properties holding references to singleton objects can use the same naming style as object declarations:
val PersonComparator: Comparator<Person> = /*...*/
https://kotlinlang.org/docs/coding-conventions.html#property-names
So in general Kotlin code the choice of whether to use a lowercase or uppercase initial letter is somewhat left up to you, depending on how the variable is used.
By "singleton objects" they might mean just objects declared using an object expression, but it's not too much of a leap to extend the same naming convention to things like individual immutable instances of a Color class.
The same UpperCamelCase naming convention can also be used for enum entries. The Color instances in your example are very similar to enum entries in their use and purpose, which I think is another argument in favour or preferring the uppercase initial letter here.
The current version of the Android Kotlin style guide is a bit less permissive here. It suggests that all variable names should be lowerCamelCase, except for constants which should be UPPER_SNAKE_CASE. On that basis, the names of the Color variables should start with a lowercase letter.
I think both your 'Code A' and 'Code B' are stylistically okay, and there are good arguments on both sides. It depends on which style guide you read, and how you interpret it. It also depends, of course, on your own personal preference and on the shared conventions you might have agreed with the co-collaborators on your codebase.