Controlling LED w/ Proximity Sensor

Through trial and error I got this code to work. The proximity readings in the serial monitor and effecting the brightness of the LED. Now I am wondering if there is a more efficient way to write the parameters of this code? I want the brightness to smoothly transition from 0 to 164 depending on the reading from the proximity sensor.

Using a series of these if statements and ints from 0-2 cm, 3-5 cm, 6-8 cm, etc all the way to ~100 cm seems inefficient and potentially could be buggy/glitchy... or maybe not, and thats the way to do it?

if(proxcont > 0 && proxcont <= 5) {
int a = 10;
FastLED.setBrightness(a);
delay(30);


#include <FastLED.h>
#include <NewPing.h>
#define LED_PIN 7
#define NUM_LEDS 151
#define CHIPSET WS2813
#define COLOR_ORDER GRB
CRGB leds[NUM_LEDS];
#define TEMPERATURE_1 Tungsten100W
#define TEMPERATURE_2 OvercastSky
#define PING_PIN 12 // Arduino pin tied to both trigger and echo pins on the ultrasonic sensor.
#define MAX_DISTANCE 120 // Maximum distance we want to ping for (in centimeters). Maximum sensor dista
NewPing sonar(PING_PIN, PING_PIN, MAX_DISTANCE);

int distance;
float proxcont = 0;
int cm = 0;

const int numReadings = 20 ;
int readings [ numReadings ] ;
int readIndex = 0;
int total = 0;
int average = 0;
int newValue = 0;
int lastpixel = 0;

// How many seconds to show each temperature before switching
#define DISPLAYTIME 20
// How many seconds to show black between switches
#define BLACKTIME 3

void setup() {
delay(1000); // power-up safety delay
Serial.begin(9600);
Serial.println("resetting");
LEDS.addLeds<WS2813,LED_PIN,RGB>(leds,NUM_LEDS).setCorrection(TypicalLEDStrip);
FastLED.setBrightness(proxcont);

for(int thisReading = 0 ; thisReading < numReadings ; thisReading++) {
readings [ thisReading ] = 0 ; }

}

void loop()
{
distance = sonar.ping_cm();
proxcont = distance;
delay(30); // Wait 50ms between pings (about 20 pings/sec). 29ms should be the shortest delay between pings.
Serial.print("distance: ");
Serial.print(sonar.ping_cm()); // Send ping, get distance in cm and print result (0 = outside set distance range)
Serial.println("cm");
delay(100);
// draw a generic, no-name rainbow
static uint8_t starthue = 0;
fill_rainbow( leds + 0, NUM_LEDS - 5, --starthue, 20);

// Choose which 'color temperature' profile to enable.
uint8_t secs = (millis() / 1000) % (DISPLAYTIME * 2);
if( secs < DISPLAYTIME) {
FastLED.setTemperature( TEMPERATURE_1 ); // first temperature
leds[0] = TEMPERATURE_1; // show indicator pixel
} else {
FastLED.setTemperature( TEMPERATURE_2 ); // second temperature
leds[0] = TEMPERATURE_2; // show indicator pixel
}

FastLED.show();
FastLED.delay(8);

if(proxcont > 0 && proxcont <= 5) {
int a = 10;
FastLED.setBrightness(a);
delay(30);
}
if(proxcont > 5 && proxcont <= 15) {
int b = 50;
FastLED.setBrightness(b);
delay(30);
}
if(proxcont > 15 && proxcont <= 30) {
int c = 100;
FastLED.setBrightness(c);
delay(30);
}

}