본문으로 건너뛰기
🛠️ToolsShed

색상 혼합기

두 색상을 혼합하고 RGB, HEX, HSL 결과를 확인합니다.

A 50% / B 50%
#6366f1
#855fdb
#a857c5
#ca50af
#ec4899

이 도구 소개

Color Mixer는 두 색상을 블렌드하고 결과를 여러 형식으로 탐색할 수 있는 간단하지만 강력한 도구입니다. 브랜드 색상을 선택하는 디자이너, 인터페이스 색상 체계를 구축하는 개발자, 색 조화를 실험하는 미술가 등 그래픽 소프트웨어나 수학 계산 없이도 모든 색상 조합의 RGB, HEX, HSL 값을 즉시 확인할 수 있습니다.

도구를 사용하려면 색상 선택기 또는 HEX 입력 필드를 사용해 두 가지 색상을 선택하거나 붙여넣은 다음 슬라이더를 사용해 블렌드 비율을 조정하여 각 색상이 최종 결과에 얼마나 영향을 미치는지 제어합니다. 믹서는 실시간으로 업데이트되며 블렌드된 출력을 3가지 색상 형식 모두와 함께 표시하므로 코드, 디자인 파일 또는 디지털 프로젝트에서 사용할 정확한 값을 쉽게 복사할 수 있습니다. 색상을 반전시키거나 개별 RGB 채널을 미세 조정하여 세밀한 제어도 가능합니다.

자주 묻는 질문

코드 구현

# RGB linear interpolation color mixing

def hex_to_rgb(hex_color: str) -> tuple[int, int, int]:
    hex_color = hex_color.lstrip('#')
    return tuple(int(hex_color[i:i+2], 16) for i in (0, 2, 4))

def rgb_to_hex(r: int, g: int, b: int) -> str:
    return f"#{r:02x}{g:02x}{b:02x}"

def mix_colors(color_a: str, color_b: str, ratio: float = 0.5) -> str:
    """
    Mix two hex colors.
    ratio=0.0 -> pure color_a
    ratio=0.5 -> equal mix
    ratio=1.0 -> pure color_b
    """
    r1, g1, b1 = hex_to_rgb(color_a)
    r2, g2, b2 = hex_to_rgb(color_b)

    r = round(r1 + (r2 - r1) * ratio)
    g = round(g1 + (g2 - g1) * ratio)
    b = round(b1 + (b2 - b1) * ratio)

    return rgb_to_hex(r, g, b)

# Generate gradient steps
def gradient_steps(color_a: str, color_b: str, steps: int = 5) -> list[str]:
    return [mix_colors(color_a, color_b, i / (steps - 1)) for i in range(steps)]

print(mix_colors("#6366f1", "#ec4899", 0.5))  # #a7559d
print(gradient_steps("#6366f1", "#ec4899"))

Comments & Feedback

Comments are powered by Giscus. Sign in with GitHub to leave a comment.