color-picker icon indicating copy to clipboard operation
color-picker copied to clipboard

Color-picker doesn't replace selected text with new color

Open EmmaRamirez opened this issue 9 years ago • 5 comments

When text, specifically colors that are listed as text, is selected and then you pick a color, color-picker doesn't replace the selected text with the new color, but instead adds the new color onto the end of that text.

So, something like red becomes redrgb(245, 111, 3).

EmmaRamirez avatar Jul 02 '15 13:07 EmmaRamirez

I'm not sure the color-picker should replace selected text if any is selected before opening it.

As for typed color names, these will unfortuneately not be supported.

thomaslindstrom avatar Jul 02 '15 15:07 thomaslindstrom

I think it should be.

Mostly because that's what I've seen color pickers on Brackets, Codepen.io, and other web tools use. I don't know if there are examples (that I can come up with) where that hasn't been the case?

EmmaRamirez avatar Jul 03 '15 02:07 EmmaRamirez

I think it should replace the selected text if the selected text was successfully parsed as a known color.

gogoprog avatar Aug 10 '15 13:08 gogoprog

@gogoprog So the current behaviour, then?

thomaslindstrom avatar Aug 11 '15 12:08 thomaslindstrom

Yes plus it would be nice to also recognize "red", "blue", etc...

gogoprog avatar Aug 11 '15 12:08 gogoprog