# How can I swap two colors in a bullet gauge?

I want to swap two colors in a bullet gauge.

Is this possible to do this without using something similar to

BulletGauge[{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8},
ImageSize -> Large,
GaugeStyle -> {Red, Blue, Green, Purple, Orange, LightBlue}]


• What is undesirable about the solution you yourself suggested? Commented Aug 16, 2016 at 8:34
• @Quantum_Oli I think that is smarter use the a swaping of the 5th color with the 6th color, using the numser 5 and 6 of a list, and not defining a color with RGB, which is longer. Commented Aug 16, 2016 at 8:36
• Related: (57133) Commented Aug 16, 2016 at 9:03

If we somehow know in advance the colors that are being used a post-processing replacement is possible.

swapIndexed[i_, c1_, c2_] := {# -> #2, #2 -> #} & @@ (ColorData[i] /@ {c1, c2})

BulletGauge[
{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8}
, ImageSize -> Large
] /. swapIndexed[63, 5, 6]


## Description

Simply change the order of colors in GaugeStyle

## Example

BulletGauge[{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8},
ImageSize -> Large,
GaugeStyle -> {Red, Blue, Green, Purple, Orange, LightBlue}]

BulletGauge[{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8},
ImageSize -> Large,
GaugeStyle -> {Red, Blue, Green, Purple, LightBlue, Orange}]


## Output

• Can I ask why your rolled back my edit when it provided a fuller answer? Commented Aug 16, 2016 at 8:50
• @Feyre the edit you've made did indeed provide a solution. Therefore I thought it would be best if you'd add it as such which would grant you extra reputation points as oppose of me taking credit for your solution :) Commented Aug 16, 2016 at 9:09

without using a swaping function.... (I don´t remeber/know native swaping function).....

gs = Table[ColorData[63, i], {i, 1, Length [ColorData[63, "ColorList"]]}]

BulletGauge[{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8},  ImageSize-> Large, GaugeStyle -> gs]
temp = gs[[5]];
gs[[5]] = gs[[6]];
gs[[6]] = temp;
gs

BulletGauge[{1, 1.8, 3, 3.4, 4, 5}, {2.4, 2.9}, {0, 3.5, 4.8}, ImageSize -> Large, GaugeStyle -> gs]