Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add a switch to reverse colours and invert palette #17911

Closed
qgib opened this issue Jan 7, 2014 · 7 comments
Closed

Add a switch to reverse colours and invert palette #17911

qgib opened this issue Jan 7, 2014 · 7 comments
Labels
Feature Request Symbology Related to vector layer symbology or renderers

Comments

@qgib
Copy link
Contributor

qgib commented Jan 7, 2014

Author Name: Paolo Cavallini (@pcav)
Original Redmine Issue: 9303

Redmine category:symbology


See http://www.bc-consult.com/free/bcccoltbl1.html#i001

@qgib
Copy link
Contributor Author

qgib commented Jan 7, 2014

Author Name: Etienne Tourigny (@etiennesky)


It is possible to invert the gradient in rasters (before classifying), but not in vectors. It should be easy to add a "invert" checkbox next to the color ramp selector in the Categorized and Graduated modes.

Updating the various gradient dialogs to support inverted colors would be somewhat more involved.

IMHO inverting palette is not feasible with cpt-city gradients.

@qgib
Copy link
Contributor Author

qgib commented Jan 9, 2014

Author Name: Etienne Tourigny (@etiennesky)


Added invert checkbox for vector layer classification (Categorized and Graduated) in 0a8c1cc .

I am not sure that "inverting palette" is so useful (and honestly difficult or impossible for cpt-city gradients), but it could be added to the standard gradient dialog.

Leaving this open for now.


  • done_ratio was changed from 0 to 50

@qgib
Copy link
Contributor Author

qgib commented Jan 9, 2014

Author Name: Etienne Tourigny (@etiennesky)


Actually, implementing "invert palette" shouldn't be too hard.

The question is, where should this option appear? In the gradient dialog boxes, or in the raster/vector classification UIs (as is done for "invert colors")?

Another question is: is this really necessary?

Here is the relevant code in the 1-band raster colour table plugin (bcccoltbl), in file Palette.py, that does the inversions.

    # interfaces to export useful objects
    def getColPalette(self, bInvert = False, bReverse = False):
        """
        -- return the colour palette array
        """
        if bInvert:
            #invert the colour palette
            for i in range(self.nColo+1):
                self.arColo[i,0] = 255 - self.arColo[i,0]
                self.arColo[i,1] = 255 - self.arColo[i,1]
                self.arColo[i,2] = 255 - self.arColo[i,2]
        if bReverse:
            #reverse the colours order
            ar = np.zeros((self.nColo+1,4),int)
            n = self.nColo
            for i in range(self.nColo+1):
                ar[i,0] = self.arColo[n -i,0]
                ar[i,1] = self.arColo[n -i,1]
                ar[i,2] = self.arColo[n -i,2]
            self.arColo = ar
        return self.arColo

@qgib
Copy link
Contributor Author

qgib commented Jan 9, 2014

Author Name: Etienne Tourigny (@etiennesky)


Added a few people to this ticket, would appreciate feddback on questions raised in last comment.

@qgib
Copy link
Contributor Author

qgib commented Jan 9, 2014

Author Name: Paolo Cavallini (@pcav)


Not sure it is necessary. I'd put it besides the "invert colour" checkbox.

@qgib
Copy link
Contributor Author

qgib commented Apr 30, 2017

Author Name: Giovanni Manghi (@gioman)


  • easy_fix was configured as 0

@qgib
Copy link
Contributor Author

qgib commented Feb 24, 2018

Author Name: Paolo Cavallini (@pcav)


Implemented


  • resolution was changed from to fixed/implemented
  • status_id was changed from Open to Closed

@qgib qgib closed this as completed Feb 24, 2018
@qgib qgib added Feature Request Symbology Related to vector layer symbology or renderers labels May 24, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature Request Symbology Related to vector layer symbology or renderers
Projects
None yet
Development

No branches or pull requests

1 participant