You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Support coloured gutter icons for Color.fromARGB/RGBO() #2218
This could be useful since the shorter Color(int value) constructor not only takes up less space, but also because the extension generates small color swatches on the left hand side when such a constructor is being used. The conversion is easy to do, but pretty laborious per hand as the opacity needs to be first scaled into a 0-255 range and then converted into hex.
The output would look like this:
before: Color.fromRGBO(78, 63, 93, .1)
after: const Color(0x1A4E3F5D)
So this would generally help with refactoring and cleaning up by saving time.
I'll keep this issue open to see if we can support that in the gutters (for the refactor, please file an SDK issue if you still think it's worthwhile after this change).
changed the title [-]Implement refactor: Convert Color.fromARGB/RGBO() into Color()[/-][+]Support coloured gutter icons for Color.fromARGB/RGBO()[/+]on Jan 15, 2020
Activity
DanTup commentedon Jan 15, 2020
The refactors shown in VS Code come from the analysis server, so this would need to be requested there (https://github.com/dart-lang/sdk).
These are just regexes, so if the pattern is consistent I think we can support this here too:
Dart-Code/src/shared/vscode/color_range_computer.ts
Lines 6 to 7 in 597e4da
I'll keep this issue open to see if we can support that in the gutters (for the refactor, please file an SDK issue if you still think it's worthwhile after this change).
[-]Implement refactor: Convert Color.fromARGB/RGBO() into Color()[/-][+]Support coloured gutter icons for Color.fromARGB/RGBO()[/+]DanTup commentedon Mar 11, 2020
More formats of colours should work now: