import { storage, KEYS } from './storage.js';
import { BACKGROUNDS, DEFAULT_BACKGROUND, getBackground } from '../config/backgrounds.js';

export function currentBackground() {
  const id = storage.getItem(KEYS.background, DEFAULT_BACKGROUND);
  return getBackground(id);
}

export function currentBgTexture() {
  return currentBackground().texture;
}

export function setBackground(id) {
  storage.setItem(KEYS.background, id);
}

export { BACKGROUNDS, getBackground };
