== Why is this an issue?

An invalid color definition may be interpreted incorrectly, which is likely to have unintended impacts on the expected look and feel of the UI. That's why it's important to use a 8-digit hexadecimal integer `(0xFFFFFFFF)` when creating a `Color` object with `Color(int)` constructor.
If only 6-digit hex value was used, the 2 leading digits will be considered `0` and interpreted as fully-transparent. Most likely this is not the desired behavior. To avoid such mistakes, either use a different constructor, or use a 8-digit hexadecimal value.

=== Noncompliant code example

[source,dart]
----
Color c1 = const Color(0x42A5F5);
Color c2 = const Color(42);
----


=== Compliant solution

[source,dart]
----
Color c1 = const Color(0xFF42A5F5);
Color c2 = const Color.fromARGB(0xFF, 0x42, 0xA5, 0xF5);
----


== Resources

* Dart docs - https://dart.dev/tools/linter-rules/use_full_hex_values_for_flutter_colors[Dart Linter rule - use_full_hex_values_for_flutter_colors]
* Dart docs - https://api.flutter.dev/flutter/dart-ui/Color-class.html[Color class]

ifdef::env-github,rspecator-view[]

== Implementation Specification
(visible only on this page)

=== Message

* "Instances of 'Color' should be created using an 8-digit hexadecimal integer (such as '0xFFFFFFFF')."

=== Highlighting

The int literal in the argument

'''

endif::env-github,rspecator-view[]
