diff --git a/components/BackgroundSelect.js b/components/BackgroundSelect.js index fdf5c5f..a9adddf 100644 --- a/components/BackgroundSelect.js +++ b/components/BackgroundSelect.js @@ -6,7 +6,9 @@ import WindowPointer from './WindowPointer' import ImagePicker from './ImagePicker' import { COLORS, DEFAULT_BG_COLOR } from '../lib/constants' import { validateColor } from '../lib/colors' -import { parseRGBA, capitalizeFirstLetter } from '../lib/util' + +const stringifyRGBA = obj => `rgba(${obj.r},${obj.g},${obj.b},${obj.a})` +const capitalizeFirstLetter = s => s.charAt(0).toUpperCase() + s.slice(1) class BackgroundSelect extends React.Component { constructor(props) { @@ -44,7 +46,7 @@ class BackgroundSelect extends React.Component { } handlePickColor(color) { - this.props.onChange({ backgroundColor: parseRGBA(color.rgb) }) + this.props.onChange({ backgroundColor: stringifyRGBA(color.rgb) }) } render() { diff --git a/lib/util.js b/lib/util.js index e7e9b05..9f72689 100644 --- a/lib/util.js +++ b/lib/util.js @@ -37,8 +37,6 @@ export const unescapeHtml = s => { } } -export const parseRGBA = obj => `rgba(${obj.r},${obj.g},${obj.b},${obj.a})` - export const getSettings = morph.compose( parse, escapeHtml, @@ -56,10 +54,6 @@ export const savePresets = (window, v) => assignPresets(window, JSON.stringify(v export const clearSettings = () => localStorage.removeItem(SETTINGS_KEY) -export const capitalizeFirstLetter = s => s.charAt(0).toUpperCase() + s.slice(1) - -export const range = n => [...Array(n).keys()] - export const fileToDataURL = blob => new Promise(res => { const reader = new FileReader()