Colour Manager: Difference between revisions

From Scribus Wiki
Jump to navigation Jump to search
m (Text replace - "Category:Scribus_development" to "Category:Development")
 
(5 intermediate revisions by 2 users not shown)
Line 1: Line 1:
[[Category:Scribus_development]]
[[Category:Development]]


== The Colour Manager ==
== The Colour Manager ==
 
*The Colour manager will be replaced by an equivalent GUI in the Resource Manager in 1.3.6+
* The colour manager is defined by <tt>colorm.cpp</tt>
* The colour manager is defined by <tt>colorm.cpp</tt>
* It's called by <tt>scribus.cpp</tt> as follows:
* It's called by <tt>scribus.cpp</tt> as follows:
  <pre>ColorManager* dia = new ColorManager(this, edc, doc, prefsManager->colorSetName(), prefsManager->appPrefs.CustomColorSets);</pre>
:<pre>ColorManager* dia = new ColorManager(this, edc, doc, prefsManager->colorSetName(), prefsManager->appPrefs.CustomColorSets);</pre>
* The constructors parameters are named as:
* The constructors parameters are named as:
** <tt>QWidget* parent = this</tt> (cannot be used outside of the constructor)
** <tt>QWidget* parent = this</tt> (cannot be used outside of the constructor)
Line 17: Line 17:
=== Hide unused colours ===
=== Hide unused colours ===


==== Adding a preference field ====
==== <strike>Adding a preference field</strike> ====
 
* <strike>Add a property in <tt>prefsmanager.h</tt></strike>
* <strike>Add a method for reading and one for writing it in <tt>prefsmanager.cpp</tt></strike>
 
==== Adding the informations in the document's informations ====
 


* Add a property in <tt>prefsmanager.h</tt>
* Add a method for reading and one for writing it in <tt>prefsmanager.cpp</tt>


==== Setting the preference from the Colour Management Dialog ====
==== Setting the preference from the Colour Management Dialog ====


* Get the prefsManager through:
* <strike>Get the prefsManager like:</strike>
:<pre>PrefsManager *prefsManager = PrefsManager::instance();</pre>
:<pre><strike>PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");</strike></pre>
* Add a checkbox to the dialog
* Add a checkbox to the dialog
* Read and set the preference
* <strike>Read and set the preference</strike>
* "Notify" the strings that are to be translated
* "Notify" the strings that are to be translated
* Correctly filter the list according to the preference
* Correctly filter the list according to the preference

Latest revision as of 23:52, 20 December 2010


The Colour Manager

  • The Colour manager will be replaced by an equivalent GUI in the Resource Manager in 1.3.6+
  • The colour manager is defined by colorm.cpp
  • It's called by scribus.cpp as follows:
ColorManager* dia = new ColorManager(this, edc, doc, prefsManager->colorSetName(), prefsManager->appPrefs.CustomColorSets);
  • The constructors parameters are named as:
    • QWidget* parent = this (cannot be used outside of the constructor)
    • ColorList EditColors = doco = edc = (HaveDoc ? doc->PageColors : prefsManager->colorSet())
    • ScribusDoc* m_Doc = doc
    • QString* docColSet = prefsManager->colorSetName() (cannot be used outside of the constructor)
    • QStringList customColSet = custColSet = prefsManager->appPrefs.CustomColorSets
  • The list of colours are read by the colour manager from the palettes and written to a m_Doc property.
  • The list of used colors can be read throug void m_Doc->getUsedColor(& ColorList &colorsToUse, bool spot)

Hide unused colours

Adding a preference field

  • Add a property in prefsmanager.h
  • Add a method for reading and one for writing it in prefsmanager.cpp

Adding the informations in the document's informations

Setting the preference from the Colour Management Dialog

  • Get the prefsManager like:
<strike>PrefsContext* dirs = PrefsManager::instance()->prefsFile->getContext("dirs");</strike>
  • Add a checkbox to the dialog
  • Read and set the preference
  • "Notify" the strings that are to be translated
  • Correctly filter the list according to the preference

Filter out the hidden colours in every colour list

  • Find all the colour lists
  • Check if the unused are to be shown, and if not, don't show them (probably, through asking m_Doc->getUsedColor()
  • When the preference is changed, all the "created" lists are to be updated (cf. changing the language from preferences)

Non alphabetical order of the colours

Some general ideas:

  • Put b/w on top
  • Put grayscales at the end

An implementation proposal by kirun0:

  • First, all greyscale colours were moved to the end of the list.
  • Then, I converted all colours to HSL colourspace.
  • The colours were grouped by hue, into chunks of about 30 degrees.
  • They were then sorted by sat+lum, so the darker colours came first, followed by the bold colours, and the light *and washed out ones last (within the group)

This was, of course for a single fixed set, the parameters will probablary need tweaking for any other given set

Translating colour names

Filter by color type

  • All
  • Used
  • RGB
  • CMYK
  • Spot
  • Grayscales

Accessibility

Faramond asked to extend the drop-down boxes in order to allow jumps to a desired named color by typing the first few letters of its name (like in a file manager.) The drop-downs could also be modified such that typing in a number jumps to color with the same number.