Silverfrost Forums

Welcome to our forums

Colours for contouring

31 May 2020 10:57 #25539

I have an application that contours field values over a plane area. Normally, I use single colours for the contours (or isolines) with a numerical label for field value. I can differentiate between positive and negative or zero values by colour, line type or the label. Fine so far.

I can also draw colour bands between those contours. If I have a set number of bands n, then I can select the RGB values for each band assuming n is small. I run into difficulties when the number of bands is uneven between positive and negative field values, and in any case, keeping zero to a particular colour makes the choice of the colour bands even more difficult.

I’ve read extensively on the subject, and a particular thing that keeps coming up is the problem of red-green colour blindness. That makes the rainbow colours less useful than you would think

I suppose that I am looking for a set of formulae for the RGB components that I can subdivide into my n1 positive and *n2 *negative bands. The nearest I have come to this is taking white for zero, and varying amounts of (say) red and blue respectively in the positive and negative zones. I suspect that there is no simple answer.

The whole business is made more complicated by the need to use less saturated colours for printing, as especially when using an inkjet too much ink makes the paper wet.

I would be grateful for any helpful suggestions.

Eddie

31 May 2020 11:24 #25540

There is a discussion of this here which gives some 'nice' colour ramps, which might assist you.

http://paulbourke.net/miscellaneous/colourspace/

Ken

31 May 2020 12:20 #25541

Hi Ken,

Thanks for the reference. It's one of the sorts of things I have read, and that reference is particularly useful in understanding the RGB v. HSL and CMYK colour models.

The problem is in determining what RGB triplets to use. For example, suppose that I have 10 steps, then I could store 10 values for each RGB component in arrays specified in a DATA statement. If I do that, then if I want 11 steps, I'm stuffed, as there isn't a function to extrapolate. While 9 steps might work by leaving step 10 off, it probably isn't good if there are 5 steps.

Also, Bourke doesn't talk in those terms, and he uses green, which makes people with red-green colour blindness have trouble. If you use the whole rainbow, there isn't an obvious colour for zero.

There are also issues with colours that can't be up against each other, like red and blue, and whether having contoured things in bands, are the contour lines still useful.

Some commercial apps always use the same number of steps, and that makes the contour band values irrational.

Thanks anyway for the Bourke reference. - its a useful read.

Eddie

Please login to reply.