Skip to main content
We’ve updated our Terms of Service. A new AI Addendum clarifies how Stack Overflow utilizes AI interactions.
Code Golf

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

Required fields*

Chinese color mixing

Objective

Given two Chinese ideographs meaning basic colors, output the ideograph that means the color resulting from mixing them.

Basic colors

The basic colors are:

  • 靑(U+9751; blue)
  • 赤(U+8D64; red)
  • 黃(U+9EC3; yellow)
  • 白(U+767D; white)
  • 黑(U+9ED1; black)

Mixed colors

  • Mixing 靑(blue) and 赤(red) yields 靘(U+9758; purple).
  • Mixing 赤(red) and 黃(yellow) yields 熏(U+718F; orange).
  • Mixing 黃(yellow) and 白(white) yields 硅(U+7845; beige).
  • Mixing 白(white) and 黑(black) yields 黻(U+9EFB; grey).
  • Mixing 黑(black) and 靑(blue) yields 黯(U+9EEF; deep blue).
  • Mixing 靑(blue) and 黃(yellow) yields 綠(U+7DA0; green).
  • Mixing 黃(yellow) and 黑(black) yields 騮(U+9A2E; brown).
  • Mixing 黑(black) and 赤(red) yields 紫(U+7D2B; wine red).
  • Mixing 赤(red) and 白(white) yields 紅(U+7D05; pink).
  • Mixing 白(white) and 靑(blue) yields 碧(U+78A7; sky blue).

(This scheme of color terms is historical, and it doesn't reflect the modern usage of Chinese.)

To summarize in Unicode points:

9751, 8D64, 9758
8D64, 9EC3, 718F
9EC3, 767D, 7845
767D, 9ED1, 9EFB
9ED1, 9751, 9EEF
9751, 9EC3, 7DA0
9EC3, 9ED1, 9A2E
9ED1, 8D64, 7D2B
8D64, 767D, 7D05
767D, 9751, 78A7

Rules

I/O format is flexible. In particular, I/O in Unicode points is okay, and outputting trailing whitespace is permitted.

Mixing colors is commutative. It is assumed that the two inputted basic colors are different.

In any case, an input not fitting into your format falls in don't care situation.

Examples

  • Given 靑 and 白, output 碧.
  • Given 赤 and 白, output 紅.

Answer*

Draft saved
Draft discarded
Cancel

AltStyle によって変換されたページ (->オリジナル) /