feat(project): 섹션 편집도 프로젝트와 같은 아사나 16색 색상표 + 밝은 색 위 글자 대비

- STAGE_COLOR_PALETTE = COLOR_PALETTE — 모든 편집창이 같은 색상표
- 섹션: 첫 칸(연회색)은 "색 없음"(NULL, 기본 회색 머리), 색 없는 섹션은 첫 칸이
  선택된 채 열림. 예전 10색으로 칠한 섹션은 저장해도 그대로(LEGACY_STAGE_COLORS)
- isLightColor: 연노랑·하늘·연분홍 등 밝은 색 위에서는 섹션 머리·사이드바 배지·
  프로젝트 제목의 글자·아이콘을 어둡게
- 정적 파일 버전 20260926k

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-09-26 13:24:19 +09:00
parent af0f87c215
commit e7e5161bdf
8 changed files with 60 additions and 16 deletions
+27 -3
View File
@@ -503,6 +503,21 @@
return "rgba(" + r + "," + g + "," + b + "," + alpha + ")";
}
// 밝은 색인지 — 아사나 16색에는 연노랑·하늘·연분홍처럼 흰 글자가 안 보이는 색이 있어
// 그 위에서는 글자·아이콘을 어둡게 쓴다. alpha/바탕색을 주면 비쳐 보이는 실제 색으로 판단.
function isLightColor(hex, alpha, overHex) {
function rgb(h) {
h = String(h || "").replace("#", "");
if (h.length === 3) h = h.split("").map(function (c) { return c + c; }).join("");
return [parseInt(h.substr(0, 2), 16), parseInt(h.substr(2, 2), 16), parseInt(h.substr(4, 2), 16)];
}
const c = rgb(hex);
if (c.some(isNaN)) return false;
const a = alpha == null ? 1 : alpha, o = rgb(overHex || "#ffffff");
const m = c.map(function (v, i) { return v * a + o[i] * (1 - a); });
return (0.299 * m[0] + 0.587 * m[1] + 0.114 * m[2]) / 255 > 0.72;
}
// 멤버 선택 후보 카드(아이콘 위 / 이름 가운데 / 체크박스 아래) — 새 프로젝트
// 모달(홈·프로젝트 페이지)과 멤버 배정 모달 3곳이 전부 이 함수 하나를 쓴다.
// /api/assignable-users 응답의 avatar 필드를 그대로 쓰므로 페이지별
@@ -983,7 +998,8 @@
(p.id === currentId ? "is-active" : "") + '">' +
handle +
'<a class="pj-tree-link" href="/project/p/' + p.id + '">' +
'<span class="pj-tree-avatar' + (p.icon ? " has-icon" : "") + '" style="background:' + (p.color || "#4573d2") + '">' +
'<span class="pj-tree-avatar' + (p.icon ? " has-icon" : "") + (isLightColor(p.color) ? " is-light" : "") +
'" style="background:' + (p.color || "#4573d2") + '">' +
projBadgeInner(p) + "</span>" +
'<span class="pj-tree-name">' + escapeHtml(p.name) + "</span></a>" + acts + "</div></li>";
}
@@ -2127,6 +2143,7 @@
? '<span class="material-symbols-outlined pj-pill-ic">' + escapeHtml(currentProject.icon) + "</span>" : "") +
escapeHtml(currentProject.name || "");
pillEl.style.setProperty("--pj-color", currentProject.color || "#4573d2");
pillEl.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2"));
}
},
// 새 최상위 프로젝트 — 이 화면에선 이동하지 않고 트리/뷰에만 추가한다.
@@ -2136,6 +2153,10 @@
},
});
function renderTree() { sideTree.render(); }
(function () {
const pill = document.querySelector(".pj-project-title-pill");
if (pill) pill.classList.toggle("is-light", isLightColor(currentProject.color || "#4573d2"));
})();
// 댓글 말풍선 더블클릭 팝업 — 공용 구현(initCommentsChat, 위쪽 정의).
// 제목은 이 화면이 이미 들고 있는 업무 목록에서 찾는다.
const cmt = initCommentsChat(function (taskId) {
@@ -2793,8 +2814,10 @@
el("pj-stage-modal-title").textContent = stage ? "\"" + stage.name + "\" 섹션 편집" : "새 섹션";
el("pj-stg-id").value = stage ? stage.id : "";
el("pj-stg-name").value = stage ? stage.name : "";
// 프로젝트와 같은 색상표. 색이 없는 섹션은 첫 칸(연회색 = 색 없음)이 선택된 채로.
const noColor = (window.PJ_STAGE_COLORS || [])[0];
getStageColor = renderColorPalette(
el("pj-stg-colors"), null, stage ? stage.color : null, window.PJ_STAGE_COLORS
el("pj-stg-colors"), null, (stage && stage.color) || noColor, window.PJ_STAGE_COLORS
);
// 기본 담당자 후보 = 업무 담당자 후보와 같다(프로젝트 멤버 + owner).
// 지금 지정된 사람이 멤버에서 빠졌어도 선택지에 남겨 칸이 비지 않게 한다.
@@ -2957,7 +2980,8 @@
col.className = "pj-col" + (s.is_done_stage ? " pj-col-done" : "");
col.dataset.stageId = s.id;
col.innerHTML =
'<div class="pj-col-head' + (s.color ? " pj-col-head-colored" : "") + '"' +
'<div class="pj-col-head' + (s.color ? " pj-col-head-colored" : "") +
(s.color && isLightColor(s.color, 0.6, "#eef0f4") ? " is-light" : "") + '"' +
(canManage ? ' draggable="true"' : "") +
(s.color ? ' style="background:' + hexToRgba(s.color, 0.6) + '"' : "") + '>' +
// 아사나처럼: 이름 바로 오른쪽에 업무 수(숫자만), 맨 오른쪽에 + / … 버튼.