もう色選びに悩まない！k-meansを使った無限色カラーパレットの自動生成


グラフを描くとき、データの種類を色で区別したいけど、matplotlibに付属するcolormapを使うと色選びに苦労することがよくある。また、ネットで見つかる配色のページでも十色程度の組み合わせしか提案されておらず、色不足に感じることもあるのではないだろうか？そこで、この記事ではk-meansクラスタリングを使い、様々な色の組み合わせを提案するプログラムを紹介する。３２色やそれ以上の多彩な組み合わせを実現できるため、グラフ描画の際には是非活用してほしい。

# 以上の文章は ChatGPT に書いてもらいましたw

タイトルも序文も、ChatGPT にお願いして書いてもらいました。ChatGPT、ありがとう！

# サンプルデータの生成

まずはサンプルデータを作ってみます。わけあって２１種類の２次元データがそれぞれ２０個ずつ存在するものとします。


```python
import numpy as np

data = []
for i in range(21):
    data.append(np.random.rand(20, 2) + i * 0.1)

data = np.array(data)
data.shape
```




    (21, 20, 2)



これを普通に散布図としてプロットするとこういうふうになるんですよね。


```python
import matplotlib.pyplot as plt

for i in range(21):
    plt.scatter(data[i, :, 0], data[i, :, 1], label=i, alpha=0.8)

plt.legend(bbox_to_anchor=(1.01, 1), loc="upper left", borderaxespad=0, fontsize=9)
plt.show()
```

![output_3_0.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/00d81c5c-e5e6-cf9f-9421-b1458adae52d.png)

    
    

どうですか？見やすいですか？見やすいと思う方は、ここから先は読まなくても大丈夫です。自分は色覚に自信がないので、見にくいです。matplotlibでは colormap というものが提供されていて、あらかじめ決められた配色の中から選べたりするんですけど、区別のしにくい色が混じっていたり、<b>「あれ？この色と、この色、同じじゃね？」</b>ってなったり、<b>「この色、ほとんど白だから見にくいんですけど〜〜！！」</b>ってなったりするわけです。主観ですけど。

# マーカーを使ってみよう

マーカーを使ってみるのは、いいアイデアですね。色だけでなく形でも区別できるように描画してくれる人、好きです。 matplotlib で描画できるマーカーをありったけ列挙してみますね。


```python
markers = [
    ".",
    ",",
    "o",
    "v",
    "^",
    "<",
    ">",
    "1",
    "2",
    "3",
    "4",
    "8",
    "s",
    "p",
    "*",
    "h",
    "H",
    "+",
    "x",
    "D",
    "d",
]
```

ランダムシャッフルします。実行するたびに順序が変わります。


```python
import random

random.shuffle(markers)
```

ほうら、見やすくなっただろう。


```python
import matplotlib.pyplot as plt

for i in range(21):
    plt.scatter(data[i, :, 0], data[i, :, 1], label=i, alpha=0.8, marker=markers[i])

plt.legend(bbox_to_anchor=(1.01, 1), loc="upper left", borderaxespad=0, fontsize=9)
plt.show()
```

![output_9_0.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d3a9a25b-6527-335e-657b-f74b6f169999.png)

    
    

これでも十分かもしれませんが、これ以降は、マーカーを使わない想定で、色だけで区別することを考えてみましょう。

# 全ての色を用意する

コンピューター上で色を表現する方法の一つに「16進数カラーコード」があります。これは、６桁の16進数で色を表現するものです。それを全て作ってみましょう。


```python
all_colors = [str(format(i, "x")).zfill(6) for i in range(16 ** 6)]
```

全部で何色あるでしょうか？


```python
len(all_colors)
```




    16777216



せ...千六百万色以上...すごい数ですね。

最初の色と最後の色を確認します。それぞれ、黒と白です。


```python
all_colors[0], all_colors[-1]
```




    ('000000', 'ffffff')



途中のいくつかのカラーコードを確認してみましょう。たしかに６桁の16進数が記載されていることがわかります。


```python
all_colors[5300000 : 5300000 + 20]
```




    ['50df20',
     '50df21',
     '50df22',
     '50df23',
     '50df24',
     '50df25',
     '50df26',
     '50df27',
     '50df28',
     '50df29',
     '50df2a',
     '50df2b',
     '50df2c',
     '50df2d',
     '50df2e',
     '50df2f',
     '50df30',
     '50df31',
     '50df32',
     '50df33']



上記のカラーコードを、３次元のベクトルに変換する関数を作りましょう。これは RGB カラーと言って、左から順に Red, Green, Blue の三原色の強さを表すベクトルです。


```python
def hex3d(hexstring):
    return [
        int(x, 16) / (16 ** 2 - 1)
        for x in [hexstring[0:2], hexstring[2:4], hexstring[4:6]]
    ]


hex3d(all_colors[5300000])
```




    [0.3137254901960784, 0.8745098039215686, 0.12549019607843137]



それでは、先ほど用意した「全ての色」を RGB ベクトルに変換しましょう。


```python
import numpy as np

X = np.array([hex3d(x) for x in all_colors])
```


```python
X
```




    array([[0.        , 0.        , 0.        ],
           [0.        , 0.        , 0.00392157],
           [0.        , 0.        , 0.00784314],
           ...,
           [1.        , 1.        , 0.99215686],
           [1.        , 1.        , 0.99607843],
           [1.        , 1.        , 1.        ]])



これで「全ての色」の準備はできました。

# k-means クラスタリングで「代表色」を決める

k-means については [過去記事](https://qiita.com/maskot1977/items/6e0724f9768ac42e1261) 等をご参照ください。今回は、それを用いて、k個の「代表色」を決めます。その「代表色」とは、互いに区別しやすい（と考えられる）、互いに十分離れた位置にある RGB ベクトルからなる色とします。たとえば 21 色に色分けしたい場合は次のようにします。


```python
from sklearn.cluster import KMeans

kmeans = KMeans(n_clusters=21, random_state=53, n_init="auto").fit(X)
```

得られた 21 個の RGB ベクトルに対して、それぞれ最も近い16進数カラーコードを見つけます。


```python
from scipy.spatial import distance

distance_matrix = distance.cdist(kmeans.cluster_centers_, X)
best_colors = sorted(
    ["#{}".format(all_colors[i]) for i in np.argmin(distance_matrix, axis=1)]
)
best_colors
```




    ['#277f3d',
     '#292e7f',
     '#29cf7e',
     '#2ad2d8',
     '#2d2ed9',
     '#3180bf',
     '#3dd725',
     '#3e2826',
     '#7e4071',
     '#808228',
     '#80c570',
     '#81d8ce',
     '#8726ce',
     '#927fc8',
     '#c22728',
     '#c4d829',
     '#d63683',
     '#d7c286',
     '#d87e39',
     '#d9c4d8',
     '#db42d7']



得られた16進数カラーコードを使ってプロットしてみましょう。


```python
import matplotlib.pyplot as plt

for i in range(21):
    plt.scatter(data[i, :, 0], data[i, :, 1], label=i, alpha=0.8, c=best_colors[i])

plt.legend(bbox_to_anchor=(1.01, 1), loc="upper left", borderaxespad=0, fontsize=9)
plt.show()
```

![output_28_0.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/8588e78d-0c4b-9cd2-7109-6421edb62719.png)

    
    

どうでしょうか？さっきより見やすくなった（データの区別がしやすくなった）と感じませんか？

マーカーを使うと、こんな感じになります。マーカーの種類として２１種類しか用意してないので、それ以上の種類のデータがある場合は、同じマーカーを別の色と組み合わせて用いるといいですね。


```python
import matplotlib.pyplot as plt

for i in range(21):
    plt.scatter(
        data[i, :, 0],
        data[i, :, 1],
        label=i,
        alpha=0.7,
        marker=markers[i],
        c=best_colors[i],
    )

plt.legend(bbox_to_anchor=(1.01, 1), loc="upper left", borderaxespad=0, fontsize=9)
plt.show()
```

![output_30_0.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/49021935-8d11-2a55-1ba7-a414bb510fda.png)

    
    

# おまけ：３色〜３２色のカラーパレットをそれぞれ4通りずつ生成

最後に、３色の場合から、３２色の場合まで、この方法で4通りずつカラーパレットを生成してご覧にいれます。下記の実行結果から、お好みのものをピックアップしていただければ、色に困ることは今後もう無くなるかもしれません。お役に立てれば幸いです。もし色の数が足りないとか、色が気に入らないなどありましたら、下記のコードを参考にご自分で実行されてください。


```python
import matplotlib.pyplot as plt
import numpy as np
from scipy.spatial import distance
from sklearn.cluster import KMeans


def hex3d(hexstring):
    return [
        int(x, 16) / (16 ** 2 - 1)
        for x in [hexstring[0:2], hexstring[2:4], hexstring[4:6]]
    ]


data = []
for i in range(32):
    data.append(np.random.rand(20, 2) + i * 0.1)

data = np.array(data)

all_colors = [str(format(i, "x")).zfill(6) for i in range(16 ** 6)]

X = np.array([hex3d(x) for x in all_colors])
```


```python
def get_color_palettes(n_color=3, n_trial=4):
    for trial in range(n_trial):
        kmeans = KMeans(n_clusters=n_color, random_state=trial, n_init="auto").fit(X)
        distance_matrix = distance.cdist(kmeans.cluster_centers_, X)
        best_colors = sorted(
            ["#{}".format(all_colors[i]) for i in np.argmin(distance_matrix, axis=1)]
        )

        print("{} colors, trial {}".format(n_color, trial + 1), best_colors)
        plt.title("{} colors, trial {}".format(n_color, trial + 1))
        for i in range(n_color):
            plt.scatter(
                data[i, :, 0],
                data[i, :, 1],
                label=best_colors[i],
                alpha=0.8,
                c=best_colors[i],
            )

        plt.legend(
            bbox_to_anchor=(1.01, 1), loc="upper left", borderaxespad=0, fontsize=9
        )
        plt.show()
```


## 3色カラーパレットの自動生成
```python
get_color_palettes(n_color=3, n_trial=4)
```

    3 colors, trial 1 ['#7e4fc3', '#80cd82', '#81533a']


![output_34_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/3040e937-1869-ec31-3408-ce6156de6715.png)

    
    

    3 colors, trial 2 ['#3c609b', '#79ba46', '#c66998']


![output_34_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/eb056a93-a605-9104-da12-a3192f3bc80c.png)

    
    

    3 colors, trial 3 ['#398054', '#837fcd', '#c37f4e']


![output_34_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/e4ed6e7d-75ab-dab3-9690-6e028dab4f21.png)

    
    

    3 colors, trial 4 ['#397fab', '#838032', '#c380b1']


![output_34_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/e598627b-dc9a-5aff-fbf6-4f7e272d2f57.png)

    
    

## 4色カラーパレットの自動生成

```python
get_color_palettes(n_color=4, n_trial=4)
```

    4 colors, trial 1 ['#3abc76', '#7643c5', '#89433a', '#c5bc89']


![output_35_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b9476e98-a910-7463-fda8-f8a6f09536a5.png)

    
    

    4 colors, trial 2 ['#3a4376', '#76bcc5', '#89bc3a', '#c54389']


![output_35_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/69e638fe-cff2-207c-d135-bb9769d251c5.png)

    
    

    4 colors, trial 3 ['#398644', '#7a39bc', '#86c5bc', '#c57943']


![output_35_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/1925bdf4-b8c0-f1e8-f304-e1083f5564b6.png)

    
    

    4 colors, trial 4 ['#3a4376', '#76bcc5', '#89bc3a', '#c54389']


![output_35_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/2993f99c-db1b-eaee-7d9b-8648da5e63d5.png)

    
    

## 5色カラーパレットの自動生成

```python
get_color_palettes(n_color=5, n_trial=4)
```

    5 colors, trial 1 ['#3ac27d', '#4443bc', '#823a3d', '#bbbc43', '#c383c4']


![output_36_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/4af782a4-edc1-3346-df17-2dd025dfa1f9.png)

    
    

    5 colors, trial 2 ['#3d7c3a', '#4343bc', '#7cc5c2', '#bbbb44', '#c53d83']


![output_36_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/1f9e0b0d-5a6e-002e-b892-287f924b5ce1.png)

    
    

    5 colors, trial 3 ['#3a823d', '#4443bc', '#82c2c5', '#bcbc43', '#c33b7c']


![output_36_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6010c03c-b360-a556-d737-66f0d9dec15c.png)

    
    

    5 colors, trial 4 ['#3c3a7d', '#43bb43', '#7cc3c4', '#bc44bc', '#c5823c']


![output_36_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/a522e4ae-c445-8594-1b42-8319581fe485.png)

    
    

## 6色カラーパレットの自動生成

```python
get_color_palettes(n_color=6, n_trial=4)
```

    6 colors, trial 1 ['#38bb4f', '#394fbb', '#733736', '#8ec8c8', '#c643b0', '#c6b143']


![output_37_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/55a61cf8-c299-ce03-46a9-bb4388ef5b0a.png)

    
    

    6 colors, trial 2 ['#377636', '#44c6b2', '#4e39bb', '#b2c644', '#bb384e', '#c88cc9']


![output_37_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/2a680f68-9bdc-bc1a-0de0-ddab8b44078a.png)

    
    

    6 colors, trial 3 ['#386339', '#3dc5aa', '#5839c2', '#a8c63d', '#c23a55', '#c79dc6']


![output_37_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/251293d9-22cc-1dc3-2389-3154f26e3da7.png)

    
    

    6 colors, trial 4 ['#376d37', '#42c6af', '#5139bd', '#adc742', '#bd3950', '#c890c8']


![output_37_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/e5790f0a-7f8e-7224-063b-eb603a3f8eaa.png)

    
    

## 7色カラーパレットの自動生成

```python
get_color_palettes(n_color=7, n_trial=4)
```

    7 colors, trial 1 ['#37c7a0', '#385c38', '#4142be', '#a3c638', '#bcbfbe', '#bd4141', '#c13fc0']


![output_38_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/a3fc584f-baa9-293b-9601-a2be95190fa7.png)

    
    

    7 colors, trial 2 ['#3bb13e', '#3c3eb3', '#41c0bf', '#7e3534', '#bfbfc0', '#c3b23e', '#c43db0']


![output_38_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b25a12a7-161a-df14-b74b-9bf6391b4982.png)

    
    

    7 colors, trial 3 ['#369636', '#3b3aaa', '#40c0b9', '#a6383a', '#babf40', '#bf41bd', '#c0c0c1']


![output_38_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/cd7f812d-b892-0454-1996-733b027ab7f5.png)

    
    

    7 colors, trial 4 ['#3c4c3e', '#3dc0b5', '#403ebf', '#79cb35', '#be40c0', '#c4503d', '#c5c2ae']


![output_38_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/791cb5cd-88b1-ff18-6e27-eff206a0861a.png)

    
    

## 8色カラーパレットの自動生成

```python
get_color_palettes(n_color=8, n_trial=4)
```

    8 colors, trial 1 ['#3f40bf', '#3fbf40', '#403f3f', '#40c0c0', '#bf3fc0', '#bfc03f', '#c04040', '#c0bfbf']


![output_39_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b21400e2-1e75-9dce-0e6c-aec5ac3bb3d6.png)

    
    

    8 colors, trial 2 ['#3f3f40', '#3fc0bf', '#4040c0', '#40bf3f', '#bf403f', '#bfbfc0', '#c03fbf', '#c0c040']


![output_39_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/ffa060d5-504d-9556-42a2-74d10919a289.png)

    
    

    8 colors, trial 3 ['#3f3fbe', '#3fc040', '#40403e', '#40bfc0', '#bf40c0', '#bfbf3f', '#c03f40', '#c0c0bf']


![output_39_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/32972ab1-14f7-06cc-2f0e-4d297a175eb3.png)

    
    

    8 colors, trial 4 ['#3f40c0', '#3fbf3f', '#403f40', '#40c0bf', '#bf3fbf', '#bfc040', '#c0403f', '#c0bfc0']


![output_39_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/c682fe6c-8f8f-2ebf-fc55-8dc875a8edb0.png)

    
    

## 9色カラーパレットの自動生成

```python
get_color_palettes(n_color=9, n_trial=4)
```

    9 colors, trial 1 ['#29bf41', '#3f3c3f', '#3f40bf', '#3fc0c3', '#7fb648', '#c03c3f', '#c040bf', '#c0c0c3', '#d6bf40']


![output_40_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/718de0c1-d9b5-324d-b078-29c4ac86c024.png)

    
    

    9 colors, trial 2 ['#3c3f3f', '#3c3fc0', '#40bf3f', '#40bfc0', '#b74980', '#be4029', '#be40d6', '#c0c33f', '#c0c3c0']


![output_40_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/781b219b-a848-f6fb-fd93-84b1b86cde76.png)

    
    

    9 colors, trial 3 ['#2a4040', '#3f3fc3', '#3fbfbf', '#3fc23f', '#80484b', '#bfbfc0', '#c0c33f', '#c13fc3', '#d6413f']


![output_40_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/4e26451f-b895-87b1-5bf8-e82b424d3407.png)

    
    

    9 colors, trial 4 ['#294041', '#3f3fc3', '#3fbfbf', '#3fc33f', '#7f4948', '#c03fc3', '#c0bfbf', '#c0c33f', '#d64040']


![output_40_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/801533cc-87b0-f248-968d-44920d08927b.png)

    
    

## 10色カラーパレットの自動生成

```python
get_color_palettes(n_color=10, n_trial=4)
```

    10 colors, trial 1 ['#2941be', '#29be41', '#3f3c3c', '#3fc3c3', '#7fb946', '#8045ba', '#c03c3c', '#c0c3c3', '#d6be41', '#d742be']


![output_41_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/54791886-d455-1035-f99f-c261d50cdf0a.png)

    
    

    10 colors, trial 2 ['#3a3c3e', '#3a3cc1', '#3ac43a', '#3ac4c5', '#789080', '#bb4427', '#bb44d8', '#c4c63c', '#c4c6c3', '#c6387f']


![output_41_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/75b72a56-62b7-0557-fe34-debc962343f7.png)

    
    

    10 colors, trial 3 ['#28bebd', '#29403f', '#3f3cc3', '#3fc33c', '#804749', '#80babc', '#c0c33c', '#c13cc3', '#d6403f', '#d7bebd']


![output_41_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/ce8e5b57-1cc6-699a-715c-ea18ce29e8f0.png)

    
    

    10 colors, trial 4 ['#274445', '#3bc4c4', '#3d3bc6', '#3dc53c', '#7e3936', '#80868a', '#c23bc6', '#c2c53c', '#c4c4c4', '#d74344']


![output_41_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/3c28a340-e2be-f777-7008-9c7a59ff9d90.png)

    
    

## 11色カラーパレットの自動生成

```python
get_color_palettes(n_color=11, n_trial=4)
```

    11 colors, trial 1 ['#283fb7', '#28be40', '#3dc3c2', '#3f3d3c', '#784cca', '#7eba47', '#ba4179', '#c04026', '#c0c4c2', '#d541d1', '#d6c140']


![output_42_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/02a5d330-98d4-f5a4-2857-794d19382cb2.png)

    
    

    11 colors, trial 2 ['#3c3839', '#3c38c6', '#3cc737', '#3cc7c8', '#4d8280', '#bbcc80', '#bc3cd6', '#bc3d29', '#bfba2a', '#bfbad5', '#c24280']


![output_42_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/0553760a-7a0d-6199-caba-66d4debb9eca.png)

    
    

    11 colors, trial 3 ['#283e3d', '#3ac8c6', '#3bc73a', '#3d39c8', '#598388', '#81393d', '#bbbe29', '#bcbbd8', '#c13bc2', '#c4c481', '#d84243']


![output_42_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/855fc243-6a71-b00d-aa98-15a97a5e481f.png)

    
    

    11 colors, trial 4 ['#264344', '#39c3c4', '#3b3cc6', '#3cc73b', '#79877f', '#7e3735', '#bc28bd', '#bcd9ba', '#c3c439', '#c682cb', '#d74441']


![output_42_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/8e800fb1-7db3-3697-8bd0-62cd51f63d26.png)

    
    

## 12色カラーパレットの自動生成

```python
get_color_palettes(n_color=12, n_trial=4)
```

    12 colors, trial 1 ['#2840bb', '#35ca80', '#3b3b3b', '#41bc27', '#43bed8', '#7f7f80', '#8134cb', '#bc2741', '#bfd844', '#c4c5c5', '#c97f34', '#d945be']


![output_43_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6ba52c84-06f1-4494-ccb2-235843d8182b.png)

    
    

    12 colors, trial 2 ['#39b829', '#39b8d7', '#3b3339', '#3b33c6', '#49d980', '#527780', '#bac72b', '#bac7d4', '#bd2f7f', '#be4629', '#bf46d6', '#ceb27f']


![output_43_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/aaad65dc-f42b-26eb-d555-ffb2885d0b84.png)

    
    

    12 colors, trial 3 ['#263e45', '#37c6c5', '#39c63c', '#3b3ac8', '#678788', '#79402f', '#b7c62a', '#b8c5d6', '#bc2f87', '#c147d8', '#ccbf81', '#d74a30']


![output_43_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/c007188a-d317-feca-86cb-98b63939fefd.png)

    
    

    12 colors, trial 4 ['#303684', '#348532', '#39c2c4', '#4344d9', '#44d944', '#542b2d', '#84847d', '#bcd8bc', '#bd27ba', '#c6c239', '#cb403b', '#cb80ca']


![output_43_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d5166623-46bd-7865-7836-bf6baa9664f4.png)

    
    

## 13色カラーパレットの自動生成

```python
get_color_palettes(n_color=13, n_trial=4)
```

    13 colors, trial 1 ['#25b63f', '#3729b6', '#3ad6ba', '#3d3936', '#407ed4', '#77797d', '#77d038', '#b729c8', '#b8d3c8', '#c12647', '#c3792c', '#d37cbc', '#d5d14d']


![output_44_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/4f5a8525-3493-9856-122e-d514e93b67a2.png)

    
    

    13 colors, trial 2 ['#25c0b8', '#394728', '#3b45d6', '#3bc93a', '#3e2d7f', '#768476', '#79c8ce', '#b738d4', '#ba392a', '#bfba26', '#c6d179', '#d1417e', '#d5b2d2']


![output_44_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b251dc8e-73bd-c168-9811-675e956f2e3d.png)

    
    

    13 colors, trial 3 ['#2f847f', '#323334', '#3334cc', '#3bd0c5', '#3ccf39', '#7d7dd0', '#7e792e', '#832e80', '#bbbb7f', '#c8c82b', '#c9c9d4', '#d03b3a', '#d03bc6']


![output_44_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/a9bdf2e4-da37-fe6a-d8e0-fc109a636d92.png)

    
    

    13 colors, trial 4 ['#25bbbb', '#2c2c58', '#338330', '#3e3ecd', '#44d942', '#7acbce', '#80807e', '#823330', '#ba25bb', '#c2c234', '#cb7ace', '#d3d3ac', '#d94442']


![output_44_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d0b5c9b4-2a7c-99b5-8583-4de97d062b1e.png)

    
    

## 14色カラーパレットの自動生成

```python
get_color_palettes(n_color=14, n_trial=4)
```

    14 colors, trial 1 ['#25ba40', '#363d38', '#3728b5', '#3b80d1', '#3bd7bb', '#767b7c', '#79cd34', '#ad292c', '#ad2ed7', '#b6d6c7', '#cb7e30', '#ce3181', '#d185c6', '#d4d34f']


![output_45_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/779e050e-7948-906c-9da5-722c97749f6f.png)

    
    

    14 colors, trial 2 ['#31c57f', '#3845d4', '#394529', '#3d2d7e', '#3ec0d6', '#43c529', '#7c8079', '#b228d0', '#b6d7d2', '#b93b27', '#c3bb27', '#c880cf', '#c8cd79', '#d23b78']


![output_45_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/dee1bf0f-d971-98af-13a2-6e0986efa808.png)

    
    

    14 colors, trial 3 ['#283736', '#298376', '#3f81db', '#3fc934', '#40daba', '#4127bc', '#7c3d33', '#8a8785', '#bac529', '#bfc3d7', '#c242d8', '#c82f84', '#d0c87f', '#d74b2d']


![output_45_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5d72f33d-9d53-1da7-2477-9040f4c97693.png)

    
    

    14 colors, trial 4 ['#29b3d2', '#2a4d2c', '#333585', '#33c978', '#463dd8', '#48c526', '#80cecc', '#853332', '#878279', '#bf26b9', '#c4c536', '#ca7acf', '#d6d2ad', '#da4540']


![output_45_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/3a251fc0-edf3-bd2e-d920-bfb285b40d1f.png)

    
    

## 15色カラーパレットの自動生成

```python
get_color_palettes(n_color=15, n_trial=4)
```

    15 colors, trial 1 ['#25bb40', '#2c85c9', '#34307a', '#404026', '#42d8bf', '#492cd5', '#757d7e', '#77d23c', '#b281dc', '#bb7a24', '#bf2540', '#c2d7c0', '#c428c0', '#d4d440', '#d97c82']


![output_46_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/2637aeef-cf3f-9516-3fe5-63794c4ef94e.png)

    
    

    15 colors, trial 2 ['#2a8b80', '#34cd31', '#34cdce', '#363929', '#3639d7', '#482a81', '#7e8035', '#7fd57f', '#8080ca', '#bb2a7e', '#c83927', '#c839d7', '#cacd31', '#cbcdce', '#d58c7f']


![output_46_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/aa45b5ab-92a8-9cb5-f374-4927df5575b4.png)

    
    

    15 colors, trial 3 ['#283834', '#28d4bc', '#2c8075', '#3dc934', '#3f25b9', '#447ada', '#7d3934', '#80d6bb', '#8e7f81', '#b6c527', '#bd3bd8', '#cd3083', '#d2b4d5', '#d64c2b', '#d6c777']


![output_46_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5b14b17f-40b6-7296-ef24-0a6ccae02deb.png)

    
    

    15 colors, trial 4 ['#28ca7e', '#2a2951', '#2eb1d8', '#317f2c', '#3c35ca', '#53d52e', '#6b7686', '#80d5bb', '#823834', '#b878dc', '#c024ba', '#c4c634', '#d17f78', '#d73935', '#d7d4bc']


![output_46_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/baef9654-d8d1-fa99-70bd-07c92298bbfd.png)

    
    

## 16色カラーパレットの自動生成

```python
get_color_palettes(n_color=16, n_trial=4)
```

    16 colors, trial 1 ['#2bae2a', '#2c7fce', '#2ccd81', '#30337c', '#433728', '#4d2ad4', '#51d4d4', '#787780', '#7cd53f', '#b67923', '#b880db', '#c12540', '#c627c0', '#c6d7bd', '#d6d33d', '#d97c7f']


![output_47_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/46a1c6c3-5f51-0647-838b-be0a77303d18.png)

    
    

    16 colors, trial 2 ['#2648d5', '#2a947a', '#35ce2e', '#35d1cd', '#383927', '#3d2d7d', '#7e28cf', '#7f8035', '#808aca', '#81d77c', '#b92a78', '#ca3a26', '#cbce30', '#ccd0cc', '#d48d7a', '#d844d3']


![output_47_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/521c0061-bfd1-f06a-8cc0-79a4a82df154.png)

    
    

    16 colors, trial 3 ['#283834', '#28d4c2', '#2b8379', '#37d239', '#3c25bc', '#437bdc', '#748b2d', '#7fd6b3', '#812640', '#8e7192', '#bd38da', '#bfd02a', '#d0b7d8', '#d43385', '#d4c07b', '#d64d2b']


![output_47_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/bfd91c9a-0729-4a67-85cf-b59ed111e600.png)

    
    

    16 colors, trial 4 ['#282951', '#29d3c0', '#2cd447', '#2d79c9', '#327c2d', '#4726c9', '#6c7684', '#7fcec4', '#813336', '#85c739', '#bc76db', '#c425b8', '#d07e78', '#d63a33', '#d6d4ba', '#d7c633']

![output_47_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/abe839d3-8d23-f675-e843-0e21efba54c4.png)


    
    
## 17色カラーパレットの自動生成


```python
get_color_palettes(n_color=17, n_trial=4)
```

    17 colors, trial 1 ['#2bae29', '#2bcf81', '#2c2bd4', '#2f3975', '#3286ce', '#453726', '#52d7d4', '#77857a', '#7bd73b', '#832fbe', '#b87923', '#ba88db', '#c12541', '#c7d9bb', '#d6d23d', '#d82bc3', '#d87a7e']


![output_48_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/e0b65de3-d29b-6071-0180-a5f3345312e5.png)

    
    

    17 colors, trial 2 ['#2939d5', '#2bb0d5', '#32cc82', '#383980', '#3c292b', '#3e802f', '#3ed62b', '#7dd1cc', '#803ed0', '#84857f', '#b22b2a', '#b4d42b', '#cb327e', '#cfcd80', '#d07f32', '#d3b6d5', '#d740d3']


![output_48_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/db758296-037f-e35f-b581-6ab7f1864afd.png)

    
    

    17 colors, trial 3 ['#273c30', '#2a26b3', '#2cd8bc', '#307bd9', '#30cd32', '#3a817a', '#792a46', '#7e8c28', '#7f36c9', '#84d773', '#85b8d5', '#c6857f', '#ce2685', '#d0cd32', '#d34228', '#d54ada', '#d8cec4']


![output_48_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d254047b-93e8-c37a-e77f-fc107c3efd51.png)

    
    

    17 colors, trial 4 ['#28d3c2', '#2ad747', '#2b2948', '#2e8233', '#3079c1', '#3d28cf', '#759b7d', '#7fd3cd', '#822e86', '#83d132', '#844926', '#b57bda', '#cc27c9', '#d4767a', '#d6c134', '#d6d4b6', '#d73236']


![output_48_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/4c05778f-04f8-c479-33d7-b19793ff815c.png)

    
    

## 18色カラーパレットの自動生成

```python
get_color_palettes(n_color=18, n_trial=4)
```

    18 colors, trial 1 ['#254c77', '#2abb29', '#2acc85', '#3084d6', '#373226', '#3e29d0', '#51d8d6', '#7b899b', '#7d2872', '#807c2c', '#81da49', '#b72cd8', '#c887d9', '#c8dbbc', '#ca3627', '#d4906f', '#d6cb2e', '#d83188']


![output_49_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/05c3192e-42da-550d-3d5d-75b9836b9c9f.png)

    
    

    18 colors, trial 2 ['#278f83', '#2944d7', '#31d1cf', '#31d837', '#34302a', '#3b2880', '#508826', '#78d683', '#7b8ed3', '#8626cc', '#8a6c74', '#b0272a', '#b9d52b', '#c6cfd7', '#d27b2e', '#d42e7e', '#d84fd4', '#d9bb83']


![output_49_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/8aff202c-2385-eed9-0902-029aff68f0de.png)

    
    

    18 colors, trial 3 ['#273b2e', '#27d6b5', '#2828b0', '#2f7cd9', '#338273', '#33ce2f', '#782a4a', '#7ad2d8', '#7b28cf', '#7f892a', '#86d572', '#8e7dbb', '#cc2983', '#ced02e', '#d23e26', '#d48b73', '#d845d8', '#d8cbc6']


![output_49_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/e12d3b32-7bd6-53ff-3433-c6ef8e03b997.png)

    
    

    18 colors, trial 4 ['#263487', '#27d5b2', '#297f3a', '#2e80d3', '#2fd536', '#432829', '#4f2bd8', '#6c8d8a', '#7cd2d2', '#87d94c', '#8c2c7b', '#907b27', '#bb7cd9', '#cf28c6', '#d13031', '#d5d4b8', '#d67b78', '#d9c832']


![output_49_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6b2c7605-4f89-ed70-a76b-ada09216f8b3.png)

    
    
## 19色カラーパレットの自動生成


```python
get_color_palettes(n_color=19, n_trial=4)
```

    19 colors, trial 1 ['#25377d', '#27cb7a', '#2a81c7', '#2b832c', '#4029d9', '#42d7d7', '#462a28', '#4fd627', '#757d64', '#82298f', '#8c83d3', '#8dd789', '#bf2a28', '#c18327', '#cd37d8', '#cdd838', '#cfd0d3', '#d8938d', '#d9327a']


![output_50_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6531e481-8f7f-4899-2396-62fb0198037f.png)

    
    

    19 colors, trial 2 ['#272fc6', '#2aaddb', '#2ad98f', '#2d3231', '#2fc628', '#31797e', '#71297a', '#72792c', '#794bd7', '#7bce65', '#7dcdcf', '#b77f95', '#b82826', '#bfd524', '#d237d6', '#d5bcda', '#d62c7a', '#d6d481', '#d77e34']


![output_50_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6ecf240b-7abc-b4a3-7ec3-f2c9909ceb10.png)

    
    

    19 colors, trial 3 ['#26d6b8', '#27382f', '#2827b3', '#2dcb2d', '#307dda', '#317e75', '#74d366', '#77294c', '#7a29ce', '#7a8429', '#7cd5d3', '#8c7eba', '#c9c925', '#cc2782', '#d08070', '#d0d984', '#d13c25', '#d740d7', '#d7bdd7']


![output_50_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6d526753-689a-c0cd-a187-c9806d5534a9.png)

    
    

    19 colors, trial 4 ['#28d742', '#29397f', '#29d8bd', '#2a8132', '#2a82cc', '#4126d6', '#422628', '#689e80', '#7fd530', '#80d4d0', '#8b2a7f', '#8e6cd4', '#906e2b', '#c8d881', '#d22d33', '#d22dcc', '#d5737f', '#d9bad7', '#d9bc29']


![output_50_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/ae4a54cc-5892-0e8b-1a54-16c43162efea.png)

    
    

## 20色カラーパレットの自動生成

```python
get_color_palettes(n_color=20, n_trial=4)
```

    20 colors, trial 1 ['#26d448', '#283477', '#2ad7be', '#2c28d2', '#2c82ca', '#2d7e2e', '#4b2925', '#68847f', '#77cd25', '#7ec5da', '#813bd4', '#8cd77f', '#8f2a75', '#b17825', '#ca80d7', '#d22934', '#d57e7a', '#d828c0', '#d8d138', '#d8d7c1']


![output_51_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/992e20c2-31fc-1846-c697-40eaab5be474.png)

    
    

    20 colors, trial 2 ['#2528ba', '#257a44', '#26cc81', '#2b7dc7', '#352731', '#3cd428', '#40d8d8', '#6f3c79', '#7d2ad4', '#7d802f', '#7ecb81', '#868bd2', '#b92727', '#bdd626', '#caced8', '#cc8094', '#d1287d', '#d73ed9', '#d9d579', '#da7c31']


![output_51_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/832a62e5-3a69-6ad5-f939-ed0278c6b3b3.png)

    
    

    20 colors, trial 3 ['#24d6bd', '#26c633', '#2727b8', '#28362e', '#307878', '#307ed9', '#6aca7d', '#762855', '#787a2b', '#7b28cd', '#7ed6d7', '#84d82a', '#8d7dc3', '#cc7e77', '#ce2683', '#ce3826', '#ceda7f', '#d83fd8', '#d8bb27', '#d8bfd6']


![output_51_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/42e92288-3805-f6c3-336c-31a09608cb2d.png)

    
    

    20 colors, trial 4 ['#27d744', '#2986c5', '#29d9bf', '#2b3d81', '#2d282c', '#318436', '#3926d7', '#78b77d', '#7dcb26', '#8064d1', '#80cfd8', '#82412b', '#872c84', '#cb8426', '#ce27ca', '#d07880', '#d488d9', '#d4d842', '#d4d9b9', '#d7273e']


![output_51_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/52e09b6d-6ddb-6890-cd16-e3c1d4a77fe2.png)

    
    

## 21色カラーパレットの自動生成

```python
get_color_palettes(n_color=21, n_trial=4)
```

    21 colors, trial 1 ['#2427bd', '#243633', '#25cc35', '#2a8679', '#2b7cd8', '#31d8ca', '#69357e', '#6b812b', '#6dd185', '#7a2dd6', '#818dcb', '#83272b', '#85d82d', '#badbd8', '#bf7f6d', '#cf297e', '#d32ed5', '#d4d681', '#d74026', '#d8be26', '#da88cd']


![output_52_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/25a5d15b-4f3d-3463-487d-fde54d0dfeb5.png)

    
    

    21 colors, trial 2 ['#262740', '#277090', '#27c0d9', '#28d42a', '#2e2ed3', '#34d380', '#377e2b', '#71278f', '#7274d8', '#7d362b', '#7dd6c4', '#80ce34', '#878677', '#bf26d9', '#cc7f31', '#cfcb7f', '#d2d3d8', '#d4282b', '#d43781', '#d57dc8', '#d6d629']


![output_52_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b702eed5-e989-96b2-388e-23b081b54491.png)

    
    

    21 colors, trial 3 ['#263d28', '#26c128', '#2929d4', '#29d6d4', '#2c3e7c', '#2cc27d', '#3a7fd2', '#727f27', '#7a2542', '#7ada41', '#7e2fc6', '#7fd0c7', '#808084', '#c67fcf', '#d02b27', '#d03681', '#d0c981', '#d1d427', '#d38039', '#d52ad7', '#d5d5d7']


![output_52_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/156619bf-57a6-6b3d-e235-6d6020195f66.png)

    
    

    21 colors, trial 4 ['#283582', '#287d38', '#2b7cca', '#2bd428', '#2dd3d8', '#30ce80', '#3c242a', '#4327d8', '#788a7f', '#806328', '#80d038', '#84d7c7', '#892783', '#9173d7', '#cb2432', '#cd2cd5', '#cece82', '#d48131', '#d4d729', '#da578b', '#dabcd7']


![output_52_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/db4fc431-b7c5-5109-9566-7bee52db5a1f.png)

    
    

## 22色カラーパレットの自動生成

```python
get_color_palettes(n_color=22, n_trial=4)
```

    22 colors, trial 1 ['#2627c2', '#26283d', '#26d83e', '#27d7c3', '#2a8180', '#327ed8', '#338026', '#71267f', '#73d981', '#7cc1d8', '#7d3b27', '#7d3cd7', '#7dc428', '#8a7f7e', '#cf7f30', '#cf7fce', '#d1d9d3', '#d226d4', '#d2d92c', '#d3272c', '#d43a7f', '#d5c47f']


![output_53_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/1ab1df4d-4d6d-1b16-f12d-83700e3436cb.png)

    
    

    22 colors, trial 2 ['#267281', '#26d2d3', '#27d32c', '#28263d', '#2827c3', '#3a7d28', '#3ad57f', '#3e7dd8', '#7e2a80', '#7f3427', '#808a7e', '#80cf30', '#80d0ce', '#8133d8', '#c47dd7', '#c57d27', '#c6d37f', '#d7263c', '#d726c3', '#d8d32b', '#d8d3d4', '#d96f7f']


![output_53_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/837b3fbd-f542-7916-de6d-6fad57b08ec4.png)

    
    

    22 colors, trial 3 ['#282929', '#2829d5', '#28d62a', '#28d6d5', '#30377f', '#30c87f', '#367f30', '#367fcf', '#7a807f', '#7d2e35', '#7d2eca', '#7dd135', '#7dd1ca', '#b77fd8', '#b97f28', '#c1d77f', '#c2287f', '#d92e2b', '#d92ed4', '#d9d12b', '#d9d1d4', '#dc8081']


![output_53_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/333d08c1-0163-8930-a7b9-716661b3712a.png)

    
    

    22 colors, trial 4 ['#267e3f', '#2a7cc8', '#2c2b29', '#2cd427', '#2d3183', '#2dd3d9', '#2ece82', '#4027da', '#77867f', '#7a8923', '#80da43', '#83d5c7', '#842e30', '#8f73da', '#902792', '#cfd182', '#d22dd3', '#d37a30', '#d3d328', '#d86d92', '#d8c0d9', '#d92540']


![output_53_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/cb66689d-ee47-461d-5d71-16e0f795f184.png)

    
    

## 23色カラーパレットの自動生成

```python
get_color_palettes(n_color=23, n_trial=4)
```

    23 colors, trial 1 ['#2429c1', '#24d6c1', '#26283b', '#26d73b', '#2b807f', '#2d80da', '#368026', '#6bd57e', '#6c2a7e', '#792ad7', '#79d5d6', '#7e3726', '#7ec826', '#877fce', '#91806d', '#d13380', '#d1cc80', '#d22bd6', '#d27f31', '#d3d4d6', '#d4282b', '#d4d72b', '#da80c3']


![output_54_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/099b3694-c49a-2c09-3d7e-76d7ff707db4.png)

    
    

    23 colors, trial 2 ['#28c983', '#29243a', '#2924c5', '#297ed6', '#2ad72d', '#2c6381', '#327e28', '#3adad8', '#7f35d8', '#7f3825', '#7f96ce', '#7fc929', '#802680', '#80856a', '#80dc8a', '#c5dad8', '#cd7f28', '#d46081', '#d4d72d', '#d57fd6', '#d62439', '#d624c6', '#d8c884']


![output_54_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d4b0ba99-fee8-26e1-eef4-621b86631c51.png)

    
    

    23 colors, trial 3 ['#277fc6', '#28397e', '#29d528', '#2a2929', '#2bd4d8', '#2fcb7e', '#358030', '#3727d9', '#78877a', '#7d2a98', '#7e75d9', '#7ed337', '#7ed4c4', '#7f3033', '#b48123', '#c427db', '#c9d682', '#d3d3d8', '#d42a83', '#d67dcd', '#d72e2a', '#d7806e', '#d8d22a']


![output_54_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/685e3271-31cc-a7d2-d88a-f4e44a7a941c.png)

    
    

    23 colors, trial 4 ['#284080', '#28bf7f', '#2c262c', '#2c26d3', '#2cd9d3', '#2dda2c', '#2f7f30', '#3080d0', '#7f2280', '#803f28', '#8040d7', '#807f80', '#80bb27', '#80c1d6', '#80dd7c', '#cf80d0', '#d07f30', '#d2da2c', '#d3262c', '#d326d3', '#d3d9d3', '#d74080', '#d7bf7f']


![output_54_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/820cd59c-eed5-9c25-6753-fa47fb60646a.png)

    
    
## 24色カラーパレットの自動生成

```python
get_color_palettes(n_color=24, n_trial=4)
```

    24 colors, trial 1 ['#2428c3', '#24d63b', '#24d6c4', '#25293b', '#288080', '#2f7fdb', '#348024', '#64d481', '#652b80', '#7c2cd8', '#7d3126', '#7dcf27', '#7dd3d8', '#837fbe', '#83805b', '#c82a80', '#c8d67f', '#cb7f25', '#d280d9', '#d62ad3', '#d6d5d3', '#d72a2c', '#d7d52c', '#d98080']


![output_55_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d5ef4381-9653-cee2-89d8-7c383cce2426.png)

    
    

    24 colors, trial 2 ['#262639', '#2726c7', '#286a80', '#28cc84', '#2980d7', '#2ad62d', '#347e26', '#3cd9d9', '#6a2981', '#7e8364', '#7f32d7', '#7f3327', '#7f8fcb', '#7fcd29', '#80d889', '#c0dadb', '#c98126', '#ca2780', '#d4797f', '#d5d62f', '#d62cd4', '#d685d6', '#d72b2b', '#d8d289']


![output_55_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/b5b5f817-3f8b-fa97-39c5-74019325b30d.png)

    
    

    24 colors, trial 3 ['#257dc4', '#26803c', '#29317f', '#2c2b27', '#2cd3d9', '#2cd426', '#2ed180', '#3828da', '#6f8a7f', '#7d8025', '#7e76da', '#802a38', '#802c9b', '#80d5c5', '#80d83d', '#c526da', '#cc7f7d', '#ccd580', '#d42b29', '#d4d3d7', '#d4d629', '#d62a82', '#d6822b', '#d77bd2']


![output_55_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/2abdf57f-ca0f-976c-92bb-f65fda6989ba.png)

    
    

    24 colors, trial 4 ['#2885d5', '#28d185', '#292a2b', '#292bd5', '#2ad72d', '#2f2880', '#2f797f', '#358229', '#3ddbd9', '#7d36d4', '#7e3a27', '#7f96d2', '#7fc72a', '#82da89', '#8a257f', '#8c8071', '#c6dad8', '#cf802c', '#d327d3', '#d4262c', '#d4d92d', '#d57fcf', '#dac382', '#db427f']


![output_55_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/486d12c7-89c2-5c3a-2a61-e27c2320b08e.png)

    
    

## 25色カラーパレットの自動生成

```python
get_color_palettes(n_color=25, n_trial=4)
```

    25 colors, trial 1 ['#23d6c1', '#24283b', '#2429c3', '#24d63c', '#287f80', '#2e7fdb', '#337f24', '#652b80', '#69d481', '#76d3d9', '#7ace25', '#7b2cd8', '#7d3027', '#827f5b', '#847fc1', '#c72780', '#ca7f25', '#cad35f', '#cdd1a0', '#d2d5e0', '#d47ed8', '#d52ad4', '#d6d520', '#d72a2c', '#d87a7e']


![output_56_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/2c5e013f-8f03-9300-18b9-8f55f3e0e2b5.png)

    
    

    25 colors, trial 2 ['#282c28', '#28d42c', '#2982d4', '#29d384', '#2a277a', '#2a7b7c', '#2b2ad3', '#3b8125', '#3bd9da', '#7d308b', '#7f91ce', '#7fd12d', '#80302d', '#80d990', '#8132db', '#818667', '#c3d9da', '#c68125', '#d2267c', '#d52bd3', '#d6797d', '#d683d5', '#d6d286', '#d6d52d', '#d72c29']


![output_56_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/50507696-a87d-8375-6e90-5674ebbabf64.png)

    
    

    25 colors, trial 3 ['#25c780', '#273580', '#287fcd', '#298132', '#2b2a28', '#2bd72b', '#2cd8d5', '#3626d8', '#658080', '#7dd881', '#7f2637', '#7f2799', '#7fcf2b', '#8065d8', '#81c8d6', '#837629', '#c47e80', '#c926d9', '#d42c28', '#d4d7d5', '#d4d82a', '#d6d280', '#d72b80', '#d77fd3', '#d8842c']


![output_56_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/9c249bb5-9d5b-d047-42ef-3097a4f1066b.png)

    
    

    25 colors, trial 4 ['#25832e', '#2782d5', '#27d181', '#292a7b', '#2b29d3', '#2b2c28', '#2cd729', '#38dad8', '#3c7c83', '#7a7e2a', '#7e38d8', '#7f9bd7', '#7fd891', '#812a2d', '#81d432', '#822885', '#9d8080', '#c8dad8', '#d327d4', '#d5292a', '#d5d62a', '#d68132', '#d780ce', '#d9ca81', '#da377f']


![output_56_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/f58332ac-2c4f-6263-9fc5-d0e000967137.png)

    
    

## 26色カラーパレットの自動生成

```python
get_color_palettes(n_color=26, n_trial=4)
```

    26 colors, trial 1 ['#25d93a', '#25d9c4', '#273381', '#29927f', '#2a292c', '#2b82d9', '#2c2ad5', '#328026', '#6cd780', '#782a7f', '#79d2da', '#7bcd25', '#7e7ec1', '#80805b', '#813326', '#842cd7', '#cbd1a0', '#cc7f26', '#cdd25f', '#d0277f', '#d280d8', '#d4d6e0', '#d57a81', '#d5d61f', '#d72a2b', '#d82ad4']


![output_57_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/23feb354-4fc7-9235-96ea-e2cfeb59f2a9.png)

    
    

    26 colors, trial 2 ['#25ca28', '#263626', '#272a7c', '#28806a', '#297ccb', '#2ad2d8', '#2c29d5', '#2cd582', '#608027', '#762986', '#7b88d7', '#7ed526', '#7fd9cf', '#812b2d', '#82d276', '#842ed7', '#857b7f', '#c68025', '#d02a81', '#d37dd0', '#d4d3d9', '#d5d588', '#d6d52d', '#d729d5', '#d72b2a', '#db8074']


![output_57_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/c9e83898-5ccd-000c-0088-83db72107af3.png)

    
    

    26 colors, trial 3 ['#26347d', '#26ca81', '#287dcd', '#292a29', '#298131', '#29d72b', '#2a28d4', '#2bd5d6', '#5c7f7e', '#7c282d', '#7cd128', '#7e2ed8', '#7fd8d3', '#812b85', '#81d47c', '#8286d3', '#877a2c', '#c57f82', '#d2d72b', '#d32b28', '#d428d3', '#d4d3d6', '#d82c7b', '#d87cd5', '#d8d381', '#da832d']


![output_57_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/3b019357-4029-dc36-6038-ce13bad939de.png)

    
    

    26 colors, trial 4 ['#272e2a', '#282ed6', '#29cf81', '#2a86d3', '#2a872a', '#2ad92b', '#2ad9d5', '#2c2681', '#36787e', '#79262a', '#7a26d4', '#7ed0d4', '#7fcf29', '#7fd97e', '#8077d5', '#81772b', '#882c7f', '#9b8680', '#d22a2a', '#d22ad5', '#d3d72a', '#d3d7d5', '#d88133', '#d881cc', '#d9ca80', '#db3880']


![output_57_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d4b263b6-0c80-579b-fecc-8ac917369077.png)

    
    

## 27色カラーパレットの自動生成

```python
get_color_palettes(n_color=27, n_trial=4)
```

    27 colors, trial 1 ['#292885', '#29d62e', '#2a83d1', '#2ad7d7', '#2b2b2c', '#2b2cd8', '#2b7b77', '#2b8225', '#2bd385', '#7b337c', '#7dd124', '#7ed2d3', '#7f72d9', '#7f908d', '#812728', '#817b32', '#8223d1', '#83db75', '#d22381', '#d3737d', '#d4d82c', '#d4d9d6', '#d58629', '#d587d3', '#d62d2b', '#d62ed6', '#d7cf82']


![output_58_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/fcabfbb7-d311-8400-20a0-ecab93014e19.png)

    
    

    27 colors, trial 2 ['#2a2989', '#2a2a2e', '#2a8024', '#2a82cf', '#2ad386', '#2ad62d', '#2ad6d9', '#2b2cda', '#2b7d74', '#7d8034', '#7e2c72', '#7fd5cf', '#8028ce', '#807de0', '#80d473', '#812c23', '#818093', '#81d423', '#d28022', '#d42b88', '#d42bda', '#d47f71', '#d4d488', '#d4d5da', '#d62a2e', '#d6d52f', '#d780ce']


![output_58_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/87ee723d-1884-8808-3d77-a1c89e9fb218.png)

    
    

    27 colors, trial 3 ['#243926', '#24c727', '#288269', '#29d2d7', '#2a28d5', '#2a7bcc', '#2b2b7c', '#2cd781', '#688128', '#78292b', '#78d929', '#7d8dd5', '#7f31d7', '#7f7281', '#7fdcd1', '#82cc7a', '#832283', '#caa02a', '#cd5f2d', '#d31e2c', '#d378d4', '#d426d6', '#d5d1d8', '#d5d986', '#d5e02d', '#d68880', '#d72e82']


![output_58_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5ff56aa7-cade-4f9c-06b2-d03ac3b65c1c.png)

    
    

    27 colors, trial 4 ['#252ad4', '#25d4d4', '#281f2b', '#28e02a', '#298088', '#2e5f2f', '#2fa02f', '#30d680', '#317fd8', '#322a80', '#772bd4', '#77d4d4', '#7d2a2c', '#7dd52b', '#857e7d', '#898026', '#8c80d5', '#8cd781', '#902681', '#d228d5', '#d2d7d5', '#d4292b', '#d4d72b', '#d98033', '#da80cc', '#dbc280', '#dc3f80']


![output_58_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5272887e-a307-806e-b033-fd55301f2f23.png)

    
    

## 28色カラーパレットの自動生成

```python
get_color_palettes(n_color=28, n_trial=4)
```

    28 colors, trial 1 ['#1dd184', '#2782cf', '#292888', '#29d72c', '#2a2b2d', '#2a8325', '#2b2cd9', '#2d7875', '#2dd6d8', '#5dd17d', '#797bdf', '#7d2c74', '#7ed325', '#7f7d33', '#812a24', '#8227cf', '#83d4d2', '#847f92', '#a2d274', '#d32686', '#d38426', '#d482d2', '#d5d7d8', '#d62b2d', '#d62dd8', '#d67676', '#d7d72b', '#e0cf87']


![output_59_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/dd055ec1-e781-b752-6321-d68dbaeb4709.png)

    
    

    28 colors, trial 2 ['#247e8a', '#27d4d3', '#2929d1', '#29d628', '#2a2a77', '#2a2c26', '#2b822d', '#2cd57c', '#307eda', '#728376', '#79d5d7', '#7c2c8b', '#7dd22c', '#7e2cdb', '#7f2730', '#83d785', '#867926', '#8882cf', '#cd5d7e', '#cfa181', '#d2d5d6', '#d3d629', '#d41d7b', '#d429d4', '#d52c27', '#d8832b', '#d8e17d', '#d97dd6']


![output_59_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5086b529-4c2c-cbae-58e2-f4b93918e0f1.png)

    
    

    28 colors, trial 3 ['#1d8377', '#262a2d', '#27d52d', '#2828d7', '#28d2d7', '#2a7bd1', '#2d2b84', '#2fd784', '#317f25', '#61817b', '#782a27', '#79d327', '#7b2dd4', '#7c8adc', '#7ddacf', '#852779', '#8ad278', '#8d7d2e', '#a2739d', '#d229d7', '#d22a2b', '#d2d4d9', '#d3d72d', '#d92b82', '#d9846f', '#d9d588', '#da7fd4', '#da8122']


![output_59_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/d5f612f2-fa8e-33df-7ef8-afbb35cc2b66.png)

    
    

    28 colors, trial 4 ['#218188', '#262bd5', '#26d4d4', '#281f2b', '#28e02a', '#2d602d', '#2fd780', '#302981', '#30a12e', '#3280d9', '#6e7a7f', '#772bd5', '#79d5d6', '#7c2a2b', '#7ed72b', '#87d182', '#8b812a', '#8d81d3', '#8e2980', '#cc8380', '#d129d5', '#d2292a', '#d2d4d5', '#d4d429', '#d9d77e', '#db7d2c', '#dc2d80', '#dc7dd4']


![output_59_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/9cb98b86-039e-4163-12fc-e4255d9e205d.png)

    
    

## 29色カラーパレットの自動生成

```python
get_color_palettes(n_color=29, n_trial=4)
```

    29 colors, trial 1 ['#24d183', '#2581d0', '#272882', '#287f27', '#2a292b', '#2bd52b', '#2c2bd7', '#2cd6d6', '#317c79', '#73d87c', '#757fda', '#7930a2', '#7c872f', '#802e1d', '#80315e', '#80d827', '#82d5d4', '#8829e0', '#8a8a8a', '#ced05e', '#d17ed4', '#d32683', '#d37d27', '#d3d29e', '#d6292c', '#d6d4e0', '#d7d41f', '#d92bd5', '#d9777b']


![output_60_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/7dd6f68a-b6dd-c6cf-775e-045fb995eda1.png)

    
    

    29 colors, trial 2 ['#253080', '#267c28', '#28da83', '#2977d3', '#2ad1d7', '#2b8a7c', '#2bd42b', '#2c26d5', '#2d282a', '#75267a', '#777f2f', '#79d07b', '#7c8cda', '#7d748c', '#7fdbd1', '#822ed4', '#82d627', '#862b28', '#caa259', '#ce1e83', '#cfa1a5', '#d27821', '#d374db', '#d3e281', '#d55e7a', '#d5d5db', '#d726d5', '#d7d726', '#d8272b']


![output_60_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/935cdc88-7173-3061-ec4b-8e8665c5bacc.png)

    
    

    29 colors, trial 3 ['#20d180', '#212e80', '#237ed3', '#247f2b', '#2c2a2a', '#2cd52a', '#2dd5d6', '#2e29d6', '#37807e', '#6adc81', '#6e227f', '#7283d4', '#75802b', '#822a2a', '#82d62a', '#862bd6', '#88d6d5', '#905e84', '#95a67e', '#ce7ed8', '#d05f2e', '#d22680', '#d2a02c', '#d2da81', '#d6e02b', '#d71f2a', '#d92ad4', '#d9d3d5', '#df8086']


![output_60_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/bfe00f56-9e0b-2345-b12a-560803f5291f.png)

    
    

    29 colors, trial 4 ['#1d8230', '#24878a', '#272be0', '#28d6d2', '#2a2b1e', '#2ad727', '#2dd778', '#2e2e60', '#2f2ca0', '#3081d9', '#5e8729', '#72777f', '#7bd6d8', '#7c2cd7', '#7e2a2a', '#82d086', '#82d72d', '#8a82d3', '#8c2781', '#a27d30', '#cf8587', '#d328d4', '#d3d4d3', '#d42829', '#d5d427', '#d6d77b', '#db2e7d', '#db7cd8', '#e37f2e']


![output_60_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/5ceeee0d-8282-a3ea-c558-9b9583b53e26.png)

    
    

## 30色カラーパレットの自動生成

```python
get_color_palettes(n_color=30, n_trial=4)
```

    30 colors, trial 1 ['#252981', '#2581d3', '#25d385', '#2be12d', '#2c1d2b', '#2c2ad8', '#2c5e2b', '#2ca22d', '#2cd6d7', '#317d7f', '#722fa1', '#75d77b', '#767eda', '#80d4d3', '#81315f', '#81852f', '#81d727', '#842d1d', '#8c29de', '#8c888a', '#cfd05e', '#d12686', '#d27fd4', '#d2d29f', '#d47c27', '#d5d4e1', '#d7d41f', '#d8282d', '#da777b', '#db2bd6']


![output_61_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/ecad5c2a-9216-eb39-81ff-161cc4196aa0.png)

    
    

    30 colors, trial 2 ['#24317f', '#26782c', '#2879d5', '#28dc81', '#2ad22a', '#2ad2d6', '#2c26d5', '#2c272a', '#2c8d7f', '#71227d', '#748b20', '#796aa5', '#79ce7e', '#7d92de', '#81da2c', '#81ded1', '#822b28', '#842cd9', '#85745f', '#ca2084', '#caa299', '#d06522', '#d3a23b', '#d3e07c', '#d478da', '#d6de24', '#d7212e', '#d7d5d8', '#d827d5', '#db627c']


![output_61_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/a1d6db7b-bea7-7c21-9e69-983a5b43c565.png)

    
    

    30 colors, trial 3 ['#1cd281', '#232a81', '#257ed3', '#257f29', '#2ad52a', '#2b2a2a', '#2c29d6', '#2cd5d7', '#327c7d', '#5ed182', '#732680', '#7586d5', '#76832d', '#7e2c2a', '#7ed828', '#812dd6', '#85d8d4', '#8c7483', '#a0cd7a', '#cf2963', '#cf6329', '#d081d5', '#d12ca3', '#d1a32b', '#d52020', '#d62be2', '#d6e22c', '#d7d5d8', '#dc817f', '#e0d787']


![output_61_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/c382dea6-5a5d-5ebd-379c-e67e16b5b31c.png)

    
    

    30 colors, trial 4 ['#22842f', '#248d8c', '#257ad9', '#26da7c', '#292a5f', '#2c27e1', '#2cd5d5', '#2d2d1e', '#2e2ea1', '#2ed628', '#5d6c71', '#7089da', '#718621', '#74cf7d', '#812ed7', '#822b29', '#85d9d3', '#872481', '#88d82a', '#9d80a3', '#a57d56', '#ceda80', '#d47bdb', '#d527d4', '#d6282b', '#d77d23', '#d8d2d5', '#d92e80', '#d9d42b', '#e38a81']


![output_61_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/54000a5e-e651-ab25-b8d1-e9f20ef9f48e.png)

    
    

## 31色カラーパレットの自動生成

```python
get_color_palettes(n_color=31, n_trial=4)
```

    31 colors, trial 1 ['#25277d', '#2588d7', '#25d283', '#269f29', '#2a1f29', '#2bd9d6', '#2c2bd6', '#2c7788', '#2ce12d', '#315e2f', '#67a25f', '#7173db', '#72278c', '#7adf88', '#7fd0da', '#80252a', '#81d928', '#86821e', '#8b27d8', '#905c61', '#908da0', '#cdce5f', '#d02480', '#d280d9', '#d4d6e0', '#d62a2a', '#d6d39f', '#d7d51f', '#d97f2a', '#da2bd4', '#dd7882']


![output_62_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/1e064a2e-d06f-054d-73c5-71f0acf69a73.png)

    
    

    31 colors, trial 2 ['#247a29', '#25d781', '#272c7a', '#28a1d2', '#2b2828', '#2bd42a', '#2c5dce', '#2d1ed4', '#2d8479', '#30e1d6', '#728722', '#75d377', '#772789', '#7a82e3', '#7f292b', '#818ca1', '#84d928', '#862cd8', '#866d5f', '#87d7d3', '#cc9f24', '#cddf86', '#d12077', '#d25b97', '#d41f25', '#d482da', '#d55f30', '#d79d78', '#d827d6', '#d9d4d6', '#d9df2e']


![output_62_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/af44318b-4983-0808-fbb3-90e2cdb6411b.png)

    
    

    31 colors, trial 3 ['#1dd57c', '#258130', '#282a77', '#2928d1', '#2a2b26', '#2a7ada', '#2a7d8c', '#2ad3d5', '#2bd528', '#5dcd80', '#76851d', '#782487', '#7a735e', '#7d292b', '#7d2fdb', '#7d92df', '#7fd82a', '#80ddd2', '#8a75a4', '#a0cf7a', '#cf2963', '#d06228', '#d1a32c', '#d32ae2', '#d42ca3', '#d4d4d9', '#d52020', '#d680d5', '#d6e22c', '#d8807c', '#e0d589']


![output_62_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/fc3cc821-d958-0203-5019-dacb3b61d215.png)

    
    

    31 colors, trial 4 ['#1da12c', '#238583', '#26d77c', '#281f29', '#2a297e', '#2c1ed3', '#2c5ed4', '#2ce1d3', '#2fa2d5', '#315e2b', '#32e229', '#65697c', '#65a02f', '#75d586', '#7c2331', '#822ddc', '#8382cf', '#86d6d8', '#88278d', '#90da2c', '#966926', '#a39372', '#d47dde', '#d4d77f', '#d52925', '#d62b74', '#d728d1', '#d8d4d3', '#dad529', '#dc7b92', '#dd822f']


![output_62_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/cb9f8e78-cfac-c931-2ca0-efe1ccfb2d8c.png)

    
    

## 32色カラーパレットの自動生成

```python
get_color_palettes(n_color=32, n_trial=4)
```

    32 colors, trial 1 ['#208cd6', '#25d083', '#272cd8', '#287784', '#289e28', '#291e2c', '#292786', '#2bdad5', '#2be12d', '#315c2e', '#5c72d2', '#689960', '#76e281', '#782171', '#7cd5da', '#7f23d0', '#80d626', '#822a24', '#8b7d26', '#915c87', '#91a5a1', '#a278e0', '#cbd35d', '#d3d3e1', '#d5282d', '#d529d8', '#d62884', '#d7d31f', '#d7d79e', '#d88073', '#d97b25', '#e17dcb']


![output_63_1.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/09331bd3-0845-3446-ae8a-18380690e3bc.png)

    
    

    32 colors, trial 2 ['#207e88', '#257c29', '#26d2d5', '#27d528', '#29287c', '#29da83', '#2a2828', '#2a28d3', '#2d7cdb', '#54a95d', '#6f565c', '#717ca3', '#76d9d7', '#7dda29', '#7e821c', '#7f30dd', '#812290', '#81242a', '#85dc89', '#8b8ddf', '#a69b61', '#d05d2d', '#d1df27', '#d3d8d9', '#d42175', '#d46289', '#d4a4a2', '#d525d2', '#d71f25', '#d875dd', '#dadd79', '#dd9e2c']


![output_63_3.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/a6bbcf48-aad0-c55b-f823-a5d1b08721b0.png)

    
    

    32 colors, trial 3 ['#25822e', '#25d778', '#282a5f', '#297cd8', '#2b27e0', '#2b31a1', '#2bd5d4', '#2c2d1e', '#2c8986', '#2cd527', '#705d5b', '#71da8b', '#77871e', '#7a93db', '#7e1e86', '#7f2edb', '#80db2c', '#812627', '#886ba4', '#88dcd7', '#8ea469', '#ce632a', '#d12b63', '#d1d884', '#d37fd7', '#d529e2', '#d52ca3', '#d5a32a', '#d5e22d', '#d72120', '#d8d3d6', '#da8281']


![output_63_5.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/6b55484f-9f50-b57c-c8e5-6330c29139d6.png)

    
    

    32 colors, trial 4 ['#1b9d33', '#271f2d', '#282185', '#29dd74', '#2b5dce', '#2be1cf', '#2d1ed9', '#2da0e0', '#2f9c94', '#30e024', '#31606d', '#365f1f', '#62a131', '#7d2a8c', '#7dd588', '#7e2630', '#8080ce', '#84d4d9', '#852cdb', '#8a7d73', '#8dda2d', '#9a7322', '#d22271', '#d3a392', '#d3de74', '#d47fde', '#d55c92', '#d62b24', '#d726d3', '#d7d8d4', '#d9d224', '#de8137']


![output_63_7.png](https://qiita-image-store.s3.ap-northeast-1.amazonaws.com/0/211162/edc0ded7-0aa5-1b02-4c8f-eab83ab95302.png)

        

# 終わりに

以上、k-meansクラスタリングを使って色の選び方を提案するプログラムを紹介した。グラフを利用してデータを視覚的に表現する場面が増えている今日において、より見やすく伝わりやすいグラフを作成することは非常に重要だ。ぜひ今回紹介したプログラムを使って、自分だけの鮮やかなカラーパレットを作ってみてほしい。

↑この文章も ChatGPT に作ってもらいましたw