highlighting hex colour: delimiter #13

Closed
teschmitz opened this Issue Dec 2, 2012 · 15 comments

Projects

None yet

3 participants

@teschmitz

I am using your plugin in a config file and I note that dash and underscore are not recognized as delimiters for hex colours (#rrggbb or #rgb)

Therefore, the following occurrences are not highlighted:

A0A0A0-

A0A0A0_

@chrisbra
Owner
chrisbra commented Dec 3, 2012

Hm, I suspect, Hex Codes shouldn't be word-bounded at all?

@chrisbra chrisbra added a commit that referenced this issue Dec 3, 2012
@chrisbra Hex colors can be word-bounded or delimited by [-_]
fixes issue #13
70c53b1
@chrisbra chrisbra added a commit that referenced this issue Dec 3, 2012
@chrisbra Really fix issue #13 b569b1d
@teschmitz

Already in use - 15 minutes after commit. Best vim extension ever!

@teschmitz

The behaviour for the following scenarios has changed. The following hex colours get highlighted now:

#FFFFFF00 (the 6 Fs are highlighted)
#FFF00 (the 3 Fs are highlighted)

It seems that you recognize # followed by 6 or 3 digits as a colour regadless of the right boundary character.
See also issue #7.

I think a 3- or 6-digit hex number should only get highlighted if preceded by a hash and followed by a non-hex digit.

@teschmitz

However, one pleasing side-effect of the current behaviour is that the RGB in RGBA hex codes get highlighted. I know you can't represent a transparent colour but I still find it useful to see the fully opaque colour.

It would be nice of 8-digit hex codes (#rrggbbaa) could get highlighted with the colour indicated by the first six digits.
However, then you would have to support 4-digit RGBA colours, too.

@chrisbra
Owner
chrisbra commented Dec 6, 2012

Hi teschmitz!

On Do, 06 Dez 2012, teschmitz wrote:

However, one pleasing side-effect of the current behaviour is that the RGB in RGBA hex codes get highlighted. I know you can't represent a transparent colour but I still find it useful to see the fully opaque colour.

I see the problem. It only happens, if you have the same color with 6
hex colors,
e.g. #aabbcc
than the matcher will also match
#aabbccdd

I can fix this easily, I think.

It would be nice of 8-digit hex codes (#rrggbbaa) could get highlighted with the colour indicated by the first six digits.
However, then you would have to support 4-digit RGBA colours, too.

#RGBA does not seem to be valid currently (at least in CSS).
How common is #RGBA? Would that look like a useful addition?

regards,

Christian

@teschmitz

On Thu, 06 Dec 2012 12:04:26 -0800
chrisbra notifications@github.com wrote:

#RGBA does not seem to be valid currently (at least in CSS).
How common is #RGBA? Would that look like a useful addition?

On second thought, I think it's best to ignore RGBA, particularly if it
is not valid CSS.

@teschmitz

small correction in help file, section "Colorizer History":

0.8: (unreleased) {{{1 -
#13 (colorizing
should not stop at word-boundaries, reported by teschmitz, thanks!)

==>

colorizing should stop at word-boundaries

@chrisbra
Owner
chrisbra commented Dec 9, 2012

Hi teschmitz!

On Fr, 07 Dez 2012, teschmitz wrote:

small correction in help file, section "Colorizer History":

0.8: (unreleased) {{{1 -
#13 (colorizing
should not stop at word-boundaries, reported by teschmitz, thanks!)

==>

colorizing should stop at word-boundaries

Yeah, but the wording is correct though. You wanted the highlighting not
to stop on word-boundaries (_ does not count as word boundary).

regards,

Christian

Arbeit ist der Fluch der trinkenden Klassen.
-- Oscar Wilde

@chrisbra
Owner
chrisbra commented Dec 9, 2012

Hi teschmitz!

On Do, 06 Dez 2012, teschmitz wrote:

On Thu, 06 Dec 2012 12:04:26 -0800
chrisbra notifications@github.com wrote:

#RGBA does not seem to be valid currently (at least in CSS).
How common is #RGBA? Would that look like a useful addition?

On second thought, I think it's best to ignore RGBA, particularly if it
is not valid CSS.

So we keep it as is.

regards,

Christian

Glaube ist Liebe zum Unsichtbaren, Vertrauen aufs Unmögliche,
Unwahrscheinliche.
-- Goethe, Maximen und Reflektionen, Nr. 624

@chrisbra chrisbra closed this Dec 14, 2012
@omeid
omeid commented Aug 18, 2016

#RRGGBBAA is now supported in Chrome, Firefox, Android, and React Native. Would be great to have support for it!

@chrisbra
Owner
chrisbra commented Aug 22, 2016 edited

What does the AA stand for? Do we need to calculate anything for that? Or do you only want to have it highlighted as the rest of the color code?

@omeid
omeid commented Aug 23, 2016

Alpha :)

@chrisbra
Owner

Can you please check latest commit?

@omeid
omeid commented Aug 25, 2016

Well do later today. Thanks for looking into this!

Sent from my iPhone

On 25 Aug 2016, at 6:13 AM, Christian Brabandt notifications@github.com wrote:

Can you please check latest commit?


You are receiving this because you commented.
Reply to this email directly, view it on GitHub, or mute the thread.

@omeid
omeid commented Aug 29, 2016

Works great. Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment