Gordon Royle wrote: > > Hi, > > What is the format of the GIMP gradient files? > > For example, the gradient "default" which goes from black->white with a > grey midpoint has the following text format: > > GIMP Gradient > 1 > 0.000000 0.500000 1.000000 0.000000 0.000000 0.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0 0 > > and the gradient French flag has the format: > > GIMP Gradient > 3 > 0.000000 0.166667 0.333333 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000 1.000000 0 0 > 0.333333 0.500000 0.666667 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 1.000000 0 0 > 0.666667 0.833333 1.000000 1.000000 0.000000 0.000000 1.000000 1.000000 0.000000 0.000000 1.000000 0 0 > > So the first number is obviously the number of segments in the gradient, > and therefore each line must describe one segment. > > The first three values are the left/middle/right end points of the > segments respectively. > > this leaves me with 8 floating point numbers and 2 integers to > describe the three colours - the first 3 numbers seem to be the > RGB values of the left end point. But what the heck are the > remaining numbers? They don't seem to correspond to anything ! The format seems to be start middle end [range 0...1] R G B A left endpoint R G B A right endpoint type where type is one of linear (0), curved, sine, sphere_increasing and shere_decreasing coloring, one of rgb, hsv_ccw, hsv_cw The type & colouring are accessible to the gradient editor (the user, I mean) in the "blending function for segment" and "Colouring type for segment" menus of the gradient editor menu. This information is available in app/gradient.c and app/gradient_header.h. Dave. -- David Neary, Marseille, France E-Mail: bolsh@xxxxxxxx