norcalli / nvim-colorizer.lua

The fastest Neovim colorizer.
Other
2.23k stars 117 forks source link

Feature Request: #56

Open Chaitanyabsprip opened 3 years ago

Chaitanyabsprip commented 3 years ago

should support hex string like "0xAARRGGBB" etc

rYR79435 commented 3 years ago

Duplicate/related: #33

What kind of format is AARRBBGG?!

Chaitanyabsprip commented 3 years ago

The format is used in flutter app and web dev. There might be other but I'm only familiar with this one. Perhaps there could be a way to set a custom string matcher? That'll solve the issue for any and every format of color codes.

rYR79435 commented 3 years ago

Huh, I've never seen that before, only RRGGBBAA. That's also whats already implemented for "#". The presence of both might be a bit of an issue when autodetecting.

Chaitanyabsprip commented 3 years ago

you match for hex color values starting with # right, I am asking for support for 0x as the prefix

Chaitanyabsprip commented 3 years ago

also, AARRGGBB https://api.flutter.dev/flutter/dart-ui/Color-class.html

rYR79435 commented 3 years ago

you match for hex color values starting with # right, ...

Wrong. I'm asking for 0x as an alternative for #.

That's also whats already implemented for "#". The presence of both might be a bit of an issue when autodetecting.only knowsonly knowsonly knows

If 0x and # are interchangeable, then 0xFFFFFF00 would be FFFFFF with alpha 00, because # assumes RRGGBBAA. That would conflict with your request.

Chaitanyabsprip commented 3 years ago

determine the color format based on filetype?

RaafatTurki commented 3 years ago

0x is in some c libraries as well such as raylib like so Color red = GetColor(0xFF0000);