import 'package:flutter/material.dart';
import 'package:puzzleweave/persistence/persistence.dart';

class Skin {
  final Color color1;
  final Color color2;
  final Color color3;
  final Color color4;
  final Color color5;
  final Color colorWhite = Color(0xfff4f2e9);
  final Color colorBlack = Colors.black;

  Color get wholeBgColor => color1; // 整个游戏背景色
  Color get coreBgColor => color2; // 核心绘制区域背景颜色
  Color get slotBgColor => color3; // 格子槽位背景颜色
  Color get slotBorderColor => color4; // 每个格子槽位的边框颜色

  final Color outLineBorderColor; // 外边框颜色
  final Color innerLineBorderColor; // 内边框颜色

  Skin(this.color1, this.color2, this.color3, this.color4, this.color5, this.outLineBorderColor, this.innerLineBorderColor);
}

class SkinHelper {
  // 未来可能有多套皮肤方案，在此定义
  static List<Skin> skins = [
    Skin(
      Colors.lightGreen,
      Colors.green,
      const Color.fromARGB(255, 44, 147, 47),
      Color.fromARGB(255, 38, 96, 12),
      const Color.fromARGB(255, 8, 66, 9),
      Colors.black,
      Colors.white,
    ),
  ];

  static Color get color1 => skins[Persistence().skin].color1;
  static Color get color2 => skins[Persistence().skin].color2;
  static Color get color3 => skins[Persistence().skin].color3;
  static Color get color4 => skins[Persistence().skin].color4;
  static Color get color5 => skins[Persistence().skin].color5;
  static Color get colorWhite => skins[Persistence().skin].colorWhite;

  static Color get wholeBgColor => skins[Persistence().skin].wholeBgColor;
  static Color get coreBgColor => skins[Persistence().skin].coreBgColor;
  static Color get slotBgColor => skins[Persistence().skin].slotBgColor;
  static Color get slotBorderColor => skins[Persistence().skin].slotBorderColor;
  static Color get outLineBorderColor => skins[Persistence().skin].outLineBorderColor;
  static Color get innerLineBorderColor => skins[Persistence().skin].innerLineBorderColor;
}
