Dolce Saito Posted July 6 Share Posted July 6 (edited) Is this possible as suggested? The drive is to sync 3 values by entering only once. I find myself filling 3 of the boxes with same value all the time. Psuedo requirement (for convenience): When lock is enabled; G.ReadOnly = B.ReadOnly = true; (Sub1) G.Value = B.Value = R.Value; Hex and HSV values => Recalculate. R.ValueChangeEvent => Goto (Sub1) (Optional) => Only leave grayscale colors in palette. greyScaleColors = palette.Where(color => color.R == color.G && color.R == color.B); When lock is disabled (from enabled state); G.ReadOnly = B.ReadOnly = false; (Optional) => Reinitialize color palette with rgb colors. Edited July 7 by Dolce Saito 1 Quote Link to comment Share on other sites More sharing options...
Reptillian Posted July 7 Share Posted July 7 I have a better idea, a checkbox on the HSV value to scale each channel value into 0-255. Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Dolce Saito Posted July 7 Author Share Posted July 7 2 hours ago, Reptillian said: I have a better idea, a checkbox on the HSV value to scale each channel value into 0-255. This feature request has nothing to do with HSV. (Paint.net moderators already stressed "enough" that HSV is there for convenience). When working with grayscale, synchronizing RGB boxes would be an invaluable addition. It would simply increase productivity by 3 times. Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 7 Share Posted July 7 On 7/6/2023 at 9:45 PM, Dolce Saito said: Is this possible as suggested? The drive is to sync 3 values by entering only once. I find myself filling 3 of the boxes with same value all the time. It is so onerous to type them in? Double-click on the value in the Red RGB input box Type in the three digit value Hit TAB Retype the three digits Hit TAB Retype the three digits Its a total of eleven key presses of four keys. Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Red ochre Posted July 8 Share Posted July 8 Perhaps create your own palette, "96 shades of grey" ?😉 1 Quote Red ochre Plugin pack.............. Diabolical Drawings ................Real Paintings Link to comment Share on other sites More sharing options...
Reptillian Posted July 8 Share Posted July 8 7 minutes ago, Red ochre said: Perhaps create your own palette, "96 shades of grey" ?😉 This is a fun coding exercise. Here's my answer to doing this: $ 96,1,1,1,"begin(const last_index=w-1;);round(x/last_index*255);" rep_output_pdn_pal greys Which gives me a 96 color palette txt file. This is the output for the most part. ; paint.net Palette File: Grayscale 96 ; Color Format - AARRGGBB ; Colors: 96 FF000000 FF030303 FF050505 FF080808 FF0B0B0B FF0D0D0D FF101010 FF131313 FF151515 FF181818 FF1B1B1B FF1E1E1E FF202020 FF232323 FF262626 FF282828 FF2B2B2B FF2E2E2E FF303030 FF333333 FF363636 FF383838 FF3B3B3B FF3E3E3E FF404040 FF434343 FF464646 FF484848 FF4B4B4B FF4E4E4E FF515151 FF535353 FF565656 FF595959 FF5B5B5B FF5E5E5E FF616161 FF636363 FF666666 FF696969 FF6B6B6B FF6E6E6E FF717171 FF737373 FF767676 FF797979 FF7B7B7B FF7E7E7E FF818181 FF848484 FF868686 FF898989 FF8C8C8C FF8E8E8E FF919191 FF949494 FF969696 FF999999 FF9C9C9C FF9E9E9E FFA1A1A1 FFA4A4A4 FFA6A6A6 FFA9A9A9 FFACACAC FFAEAEAE FFB1B1B1 FFB4B4B4 FFB7B7B7 FFB9B9B9 FFBCBCBC FFBFBFBF FFC1C1C1 FFC4C4C4 FFC7C7C7 FFC9C9C9 FFCCCCCC FFCFCFCF FFD1D1D1 FFD4D4D4 FFD7D7D7 FFD9D9D9 FFDCDCDC FFDFDFDF FFE1E1E1 FFE4E4E4 FFE7E7E7 FFEAEAEA FFECECEC FFEFEFEF FFF2F2F2 FFF4F4F4 FFF7F7F7 FFFAFAFA FFFCFCFC FFFFFFFF For the OP, you could copy and paste this into a .txt file and place it into palette folder, and then open PDN. 2 Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Tactilis Posted July 8 Share Posted July 8 5 hours ago, Reptillian said: $ 96,1,1,1,"begin(const last_index=w-1;);round(x/last_index*255);" rep_output_pdn_pal greys gmic ? Quote Link to comment Share on other sites More sharing options...
Dolce Saito Posted July 8 Author Share Posted July 8 10 hours ago, Ego Eram Reputo said: It is so onerous to type them in? Double-click on the value in the Red RGB input box Type in the three digit value Hit TAB Retype the three digits Hit TAB Retype the three digits Its a total of eleven key presses of four keys. This is the reason for the suggestion, not the solution. Think about doing this every 20 seconds for hours. Quote Link to comment Share on other sites More sharing options...
Reptillian Posted July 8 Share Posted July 8 4 hours ago, Tactilis said: gmic ? Yes. Can be done easily with Python too. One could split 255 colors into a set of 96 colors and save them as separate file. This is the only workaround for now. Quote G'MIC Filter Developer Link to comment Share on other sites More sharing options...
Tactilis Posted July 8 Share Posted July 8 (edited) 22 hours ago, Dolce Saito said: This is the reason for the suggestion, not the solution. Think about doing this every 20 seconds for hours. OK, here's a simple solution to save you lots of effort: 1. Type a value in the R field 2. Press Shift+Enter This AutoHotkey script: 1. Gets the value entered in the R field (the cursor must be in that field when you press Shift+Enter) 2. Tabs to the G field and enters the value 3. Tabs to the B field and enters the value 4. Tabs back to the R field so you can immediately change the value if required It works really well. Spoiler ; AutoHotKey script: 'Global Hotkeys.ahk' ; ; Create a shortcut to this .ahk script file in the Windows Startup folder, which can be ; found by entering shell:startup in Windows Explorer's address bar. ; The usual location is: ; C:\Users\<users_folder>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup ; ; Require the use of AHK v2.0 or later #Requires AutoHotkey v2 ; Allow only one instance of the script to be active. ; If the script is re-run (e.g. after editing the .ahk), the currently running ; instance will be replaced with the new version #SingleInstance Force ; ----------------------------------------------------------------------------- ; Hotkey Shift+Enter ; Copies the current value in the Colors RGB R field to the G and B fields ; Tabs back to the R field ; ; The cursor must be in the R field when Shift+Enter is pressed #HotIf WinActive("ahk_exe paintdotnet.exe") +Enter:: { Val := ControlGetText(ControlGetFocus()) Send "{Tab}" Sleep 50 ControlSetText(Val, ControlGetFocus()) Send "{Tab}" Sleep 50 ControlSetText(Val, ControlGetFocus()) Send "+{Tab}+{Tab}" } Notes: 1. I use ControlGetText and ControlSetText instead of doing a copy and paste so that I don't change the contents of the clipboard. 2. A short sleep is needed after sending Tab to move to the next field otherwise ControlSetText may fail to update the control. I found that 5-10ms was reliable, so added a safety factor by making it 50ms. 3. I could have added checks to ensure that the cursor was in the R field of the Colors window when Shift+Enter was pressed but that would have complicated the script unnecessarily. Edited July 9 by Tactilis Fix typo 2 Quote Link to comment Share on other sites More sharing options...
Lemonade Posted July 8 Share Posted July 8 This is really great @Tactilis! Works on RGB and HSV fields. There is one thing I changed, because AutoHotkey asked for version 1: ##HotIf WinActive("ahk_exe paintdotnet.exe") Removed one # from the beginning of the line. Quote Link to comment Share on other sites More sharing options...
Tactilis Posted July 9 Share Posted July 9 8 hours ago, Lemonade said: ##HotIf WinActive("ahk_exe paintdotnet.exe") Removed one # from the beginning of the line. Thanks for finding that @Lemonade It was a silly copy/paste error when I extract this single HotIf block from my 'Global Hotkeys.ahk' script that contains all my hotkey definitions. I've edited my post above to fix it. 1 Quote Link to comment Share on other sites More sharing options...
Dolce Saito Posted July 12 Author Share Posted July 12 I'm glad it worked for somebody else, however installing AutoHotkey is not an option. Suggested feature is very easy to use, solves a problem and never requires you to depend anything other than paint.net ecosystem. Quote Link to comment Share on other sites More sharing options...
Solution Rick Brewster Posted July 12 Solution Share Posted July 12 Suggested feature is also very niche, and would require a lot of work on my part. Sorry but it's definitely not in any current plans, nor is it likely to be. Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Tactilis Posted July 12 Share Posted July 12 (edited) 19 minutes ago, Dolce Saito said: Suggested feature is very easy to use, solves a problem and never requires you to depend anything other than paint.net ecosystem. Agreed. But it's not currently part of paint.net and might not be for a long time (UPDATE: or in fact ever), depending on Rick's priorities. You said earlier that having a means of having the same value for RGB entered automatically "would simply increase productivity by 3 times." Using AutoHotKey to do that is trivially easy. But you have stated "however installing AutoHotkey is not an option" Out of interest, why is it not an option? Edited July 12 by Tactilis Update added after Rick's post Quote Link to comment Share on other sites More sharing options...
Ego Eram Reputo Posted July 12 Share Posted July 12 2 hours ago, Dolce Saito said: however installing AutoHotkey is not an option. and... 2 hours ago, Rick Brewster said: Sorry but it's definitely not in any current plans, nor is it likely to be. ....which leads me back to my original suggestion: On 7/8/2023 at 9:33 AM, Ego Eram Reputo said: Double-click on the value in the Red RGB input box Type in the three digit value Hit TAB Retype the three digits Hit TAB Retype the three digits Quote ebook: Mastering Paint.NET | resources: Plugin Index | Stereogram Tut | proud supporter of Codelab plugins: EER's Plugin Pack | Planetoid | StickMan | WhichSymbol+ | Dr Scott's Markup Renderer | CSV Filetype | dwarf horde plugins: Plugin Browser | ShapeMaker Link to comment Share on other sites More sharing options...
Rick Brewster Posted July 12 Share Posted July 12 Or even ... Double-click on the value in the Red RGB input box Type in the three digit value Press Shift+Home (select to beginning of text) and then Ctrl+C (copy to clipboard) Hit TAB (next UI control) Ctrl+V (Paste) Hit TAB Ctrl+V Quote The Paint.NET Blog: https://blog.getpaint.net/ Donations are always appreciated! https://www.getpaint.net/donate.html Link to comment Share on other sites More sharing options...
Tactilis Posted July 13 Share Posted July 13 Or all with the left hand (and hardly any hand movement if you use your pinky finger for the Ctrl key): Double-click on the value in the Red RGB input box Type in the three digit value Press Ctrl+A (select all) and then Ctrl+C (copy to clipboard) Hit TAB (next UI control) Ctrl+V (Paste) Hit TAB Ctrl+V But the OP said: On 7/8/2023 at 9:10 AM, Dolce Saito said: Think about doing this every 20 seconds for hours. ...so I worry about them getting RSI, which I why I offered: 1. Type a value in the R field 2. Press Shift+Enter which is any easy solution if they would just give AutoHotkey a try.@Dolce Saito I'm happy to answer any questions if you need help. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.