Closed johnmb25 closed 4 years ago
I'm assuming you mean when palette = "limited"
?
This won't be (easily) possible because the colour names that you want are R names, but the colours are generated by a javascript library. The JS library doesn't currently support colour names on hover. It could be added, but it would have to first be implemented in the javascript library, and only then this package can be updated.
If you know javascript and are able and interested in doing that, I would welcome a PR to this project: https://github.com/daattali/jquery-colourpicker But unfortunately I don't have enough time to do that myself as this feature is not a priority.
A follow-up question/request more to the point of option B above, that the colorbox generated by inputColour
displays the R color name:
Is there a way to instead of typing in the hex code into the colorbox one can supply the R color name and the colorbox changes to that color? I.e., instead of typing in #0000FF and the box (and return value with returnName=TRUE
returning "blue") simply typing in blue changes the color (and return value) to blue?
I fear the answer is similar to what @daattali mentions above.
Thanks!
@bklingen that wouldn't be possible unless you want to hardcode all the R colour names into the javascript library. Whenever you type into that box, you're interacting directly with the javascript widget, and it's not aware of what R colour names are. Adding R as a middle layer in that communication for the sole purpose of telling JS what the colour is seems very wasteful and complex for a fairly small gain, so I definitely don't want to go that route. Therefore, the only solution I see for that is providing JS ahead of time with all the possible colour names. Which, again, would have to be done in the javsacript plugin's repository, not here :)
I don't think this will ever be implemented so I'm closing the issue. If anybody ever wants to submit a PR for this, that would be welcomed
Thanks for making this awesome tool! It's been super helpful in making my Shiny app much more user-friendly. I'm currently using colourInput in my Shiny app, and in my case it would be helpful if the user could see the color name for each of the possible colors (before they select a color, not just for the selected color). It would be great if either: A) When the user hovered over each of the possible color choices, they saw the color name displayed. B) The boxes that display the possible colors also contained text displaying the color name.
Would either of these be feasible to implement?