smart-leds 0.4.0

A crate to use smart-leds device drivers
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
#!/usr/bin/env python3

# Generate an LED gamma-correction table

gamma = 2.8 # Correction factor
max_in = 255
max_out = 255

print("// Format this before using")
print("const GAMMA8: [u8; 256] = [")
for i in range(max_in + 1):
    print(str(int(pow(i/max_in, gamma) * max_out + 0.5)) + ", ")
print("];")