Update library.js

added if statement to calculate rgb and replace font color if swatch color is too dark.