행성 Level 1~100 수치표 적용 · 행성 컬러 마스터

This commit is contained in:
Sn-Kinos
2026-10-05 22:20:51 +09:00
parent cc0f2fb292
commit 000c058097
12 changed files with 424 additions and 64 deletions
@@ -42,7 +42,8 @@ class PlanetCreateScreen extends StatefulWidget {
'shape6',
];
/// 색 키와 칩 색 — 렌더링과 같은 표([planetColors]).
/// 기본 색 키와 칩 색(Figma `2066:17910`). 화면은 컬러 마스터(`config/planetColors`, 10/3 #6)를
/// [HomeRepository.planetColorOptions] 로 읽어 덮는다 — 발주사가 더한 색도 고를 수 있다.
static const colors = planetColors;
@override
@@ -53,6 +54,19 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
int _shape = 0;
int _color = 0;
bool _colorStep = false;
List<(String, Color)> _colors = PlanetCreateScreen.colors;
@override
void initState() {
super.initState();
widget.repository.planetColorOptions().then((options) {
if (!mounted || options.isEmpty) return;
setState(() {
_colors = options;
_color = _color.clamp(0, options.length - 1);
});
});
}
static const _placeholder = AssetImage(
'assets/figma/planet-shape-placeholder.png',
@@ -72,7 +86,7 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
child: _colorStep
? ColorFiltered(
colorFilter: ColorFilter.mode(
PlanetCreateScreen.colors[_color].$2,
_colors[_color].$2,
BlendMode.modulate,
),
child: const Image(image: _placeholder),
@@ -141,7 +155,7 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
);
/// 사본 `Frame 1984081340` — 28 원 · 간격 8 · 고른 칩 분홍 4 테두리, 나머지 흰 2.
Widget _colors() => Column(
Widget _colorPicker() => Column(
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(context.l10n.planetBgColor, style: _heading),
@@ -150,19 +164,19 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
spacing: 8,
runSpacing: 8,
children: [
for (var i = 0; i < PlanetCreateScreen.colors.length; i++)
for (var i = 0; i < _colors.length; i++)
GestureDetector(
onTap: () => setState(() => _color = i),
child: Semantics(
button: true,
selected: _color == i,
label: PlanetCreateScreen.colors[i].$1,
label: _colors[i].$1,
child: Container(
width: 28,
height: 28,
decoration: BoxDecoration(
shape: BoxShape.circle,
color: PlanetCreateScreen.colors[i].$2,
color: _colors[i].$2,
border: Border.all(
color: _color == i
? AppColors.cosmicAccent
@@ -200,7 +214,7 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
children: [
_preview(),
const SizedBox(height: AppSpace.s5),
if (_colorStep) _colors() else _shapes(),
if (_colorStep) _colorPicker() else _shapes(),
],
),
),
@@ -257,7 +271,7 @@ class _PlanetCreateScreenState extends State<PlanetCreateScreen> {
await widget.repository.createPlanet(
fandomId: widget.fandomId,
planetType: PlanetCreateScreen.shapes[_shape],
colorKey: PlanetCreateScreen.colors[_color].$1,
colorKey: _colors[_color].$1,
);
if (mounted) Navigator.of(context).pop(widget.fandomId);
} on BackendException catch (e) {