The solution proposed by @Xi Jin is available for raster layers only and is for color maps, not color ramps. Even though very similar, the concepts are different: a color map assigns pre-defined colors (could be a color ramp) to certain values (numbers or classes) - like assigning elevation data to a topographic color ramp: 0 to 200 m: green; 200 to 500 m: yellow; 500 to 1000 m: brown; over 1000 m: white
. Thus color maps are a more narrow concept: color ramp are just ordered gradients of colors, without assigning actual values: green, yellow, brown, white
. See also here for color maps: https://pvanb.wordpress.com/2014/02/05/creating-a-qgis-color-map-from-text-file/
The standard way to import color ramps from a file or a URL is using Menu Settings / Style Manager
, where you have a button to import/export files - see documentation for Style Manager. The color ramps you add in this way will permanently be available everywhere in QGIS.
If you want to create your own color ramps, click the green +
symbol. You can add a Name
and Tag(s)
for the color ramps created to be easier to find/identify them when you have a lot of color ramps.
Color ramps created in this way can be exported (to share) again with the button on the left.
For all color ramps you create or import, set the checkbox Add to favorites
for those color ramps that you want to be added to favorites. They will be immediately visible in the drop down list when selecting color ramps - all others are hidden behind All Color Ramps
:
Assigning names and tags helps you to keep an overview of your color ramps and other styles.
By the way, the style managar can be used in the same way for other styles like composed styles for vector layers (points, lines, polygons), for texts/labels, legend symbos and 3D symbols. So it is a powerful tool to create and administrate everything connected with styles.