Page 1 of 1

Customize default colors

Posted: Sat Apr 14, 2018 10:32 am
by dfriasb
Hello all,

I was asking me if it is possible to customize the default colours palette, the one I show in the attached image. I was looking for some file in qcad folder (color library or something like this) but I didn't find anything.

Do you know how to modify the colours list of that menu?

Re: Customize default colors

Posted: Mon Apr 30, 2018 10:47 am
by andrew
I've added RColor.addColor("MyColor", new RColor(r, g, b)) to the QCAD API for the next release.

Re: Customize default colors

Posted: Sat Jun 23, 2018 7:51 pm
by jvalencia
andrew wrote:
Mon Apr 30, 2018 10:47 am
I've added RColor.addColor("MyColor", new RColor(r, g, b)) to the QCAD API for the next release.
I also find this feature useful. What does it mean? that it will be supported in new versions? or someone can make a plugin for that?

Re: Customize default colors

Posted: Mon Jun 25, 2018 4:42 pm
by andrew
jvalencia wrote:
Sat Jun 23, 2018 7:51 pm
I also find this feature useful. What does it mean? that it will be supported in new versions? or someone can make a plugin for that?
It's part of the next release.

Re: Customize default colors

Posted: Fri May 16, 2025 1:25 pm
by ikua
Hello!

I do not understand how this should work. I enter the following in the script shell and nothing changes in the color selection:
RColor.addColor("xxxxxxxx", new RColor(33,44, 44))

would be big help to have this custom colors.

greets ikua

Re: Customize default colors

Posted: Fri May 16, 2025 1:39 pm
by andrew
If you just want to add custom colors to your QCAD installation, you can simply configure them under:
Edit > Application Preferences > General > Color Palette

The import button takes you to many preconfigured color palettes that come with QCAD.

Re: Customize default colors

Posted: Sat May 17, 2025 6:06 am
by CVH
@ikua,

I think that the better answer would be:
If you just want to add custom colors to your QCAD installation, you can NOW simply configure them under:
Because that has been re-coded and changed twice since Andrew's reply above on Mon Apr 30, 2018 11:47 am.
Defining custom colors (QCAD Pro) was added in 2021 and later updated to the current state including a vast list of pre-defined palettes.

Strangely RColor.addColor(..) works for the Layer combo box but not for the entity combo box.
The difference would be that the first list is limited and does not display 'By Layer' or 'By Block' for example.
But it is also overwritten every next change to the color list or on any re-initialization.

RGB(33, 44, 44) is equal to #212c2c
As importing a palette in the preference page lists for example:

Code: Select all

3M 160-30,#eff3ee
3M 180-10,#f0f3f1
3M 100-10,#f9f9f4
3M 100-20,#f9f8f5
3M 100-383,#f0e7da
We might assume that:

Code: Select all

ikua Color xxxxxxxx, #212c2c
is also valid ...
... But it isn't, the space after the comma is the flaw.
:arrow: Trimming leading and/or trailing whitespace for both parts would have been a neater solution.

To include only your custom color in the preference page simply include this line:

Code: Select all

ikua Color xxxxxxxx,#212c2c
One can revert to standard by hitting the 'Restore to Default Values' button, right-high in the preference page.

Regards,
CVH