texstudio-org / texstudio

TeXstudio is a fully featured LaTeX editor. Our goal is to make writing LaTeX documents as easy and comfortable as possible.
http://www.texstudio.org/
GNU General Public License v3.0
2.74k stars 344 forks source link

Colour Picker #2018

Open aleksejalex opened 2 years ago

aleksejalex commented 2 years ago

Hi, I think it would be great to implement simple colour picker (wheel like for example or any other). I'm pretty sure Qt has something like that already 'built in'.

Any answer on that will be highly appreciated.

tmelorc commented 2 years ago

Geany has one. Maybe it could be possible to use its code freely.

aleksejalex commented 2 years ago

Geany has one. Maybe it could be possible to use its code freely.

Yeah, maybe it'll work

fjpereny commented 2 years ago

Hi I was working on implementing a color picker, couple of questions I need help on to implement:

  1. I was thinking the code would be \colorx package, is this basically what everyone is using?
  2. I am having trouble finding a pointer in the code that gets me the latex document and cursor location. I have been looking through the code but if anyone can point me in the direction then I can begin implementation.

I was thinking about a quick standard color picker (available in Qt already) that just pops in the \colorx{RGB} code at cursor location, would that meet the needs of users?

tmelorc commented 2 years ago

Hello. This could lead to a very long discussion. So, some points to be in mind:

  1. the picker will insert only the color code (rgb, cmyk, ...)
  2. the picker will insert also color by names, supported by latex packages
  3. the picker will insert the whole code around the selected text or the whole code with empty braces if no text was selected
  4. the picker contains options to control the action

Well, the first idea could be the simplest one. The picker window does not block the txs window. So we can open it and continue working on the text and selecting words and insert colors and so on. This could be useful for repetitions.

About its action, I think that the situation could be number 3 above.

Regards and thanks.

tmelorc commented 2 years ago

In addition, usually I use xcolor package and \textcolor{<colorname>}{<text>}. Rarely I use {\color{<color>} text} syntax from base LaTeX.

aleksejalex commented 2 years ago

Hi, I think colorx is the most used and totally sufficient

On Thu, Jul 21, 2022, 07:30 Frank Pereny @.***> wrote:

Hi I was working on implementing a color picker, couple of questions I need help on to implement:

  1. I was thinking the code would be \colorx package, is this basically what everyone is using?
  2. I am having trouble finding a pointer in the code that gets me the latex document and cursor location. I have been looking through the code but if anyone can point me in the direction then I can begin implementation.

I was thinking about a quick standard color picker (available in Qt already) that just pops in the \colorx{RGB} code at cursor location, would that meet the needs of users?

— Reply to this email directly, view it on GitHub https://github.com/texstudio-org/texstudio/issues/2018#issuecomment-1191056161, or unsubscribe https://github.com/notifications/unsubscribe-auth/AG6X7J7WCHEU5FXAQ64AFM3VVDN6BANCNFSM5J7BKJSA . You are receiving this because you authored the thread.Message ID: @.***>

fjpereny commented 2 years ago

I'll work on this when I have a bit of spare time.

aleksejalex commented 2 years ago

OK, great. Thanks!