ColorSense-for-Xcode icon indicating copy to clipboard operation
ColorSense-for-Xcode copied to clipboard

`-Wconversion` compliant floats

Open Ashton-W opened this issue 9 years ago • 0 comments

When using this wonderful plugin, code is generated like so:

[UIColor colorWithRed:0.065 green:0.576 blue:0.865 alpha:1.000];

This will cause warnings if -Wconversion is on:

error: implicit conversion loses floating-point precision: 'double' to 'CGFloat' (aka 'float') [-Werror,-Wconversion]

It can be fixed with a simple change:

[UIColor colorWithRed:0.065f green:0.576f blue:0.865f alpha:1.000f];

ColorSense should use the later format, with f type specifiers.

Ashton-W avatar Aug 27 '14 01:08 Ashton-W