color-names icon indicating copy to clipboard operation
color-names copied to clipboard

Create sorted_colors-json.txt

Open imvickykumar999 opened this issue 5 years ago • 0 comments

this may be helpful dictionary to get color tuple code, I generated this using my very own algo using your colors.csv file by applying pandas inbuilt function. I request you to please merge my pull request in your repo. !!!

algo is:

import pandas as pd df = pd.read_csv('https://raw.githubusercontent.com/codebrainz/color-names/master/output/colors.csv') dbox, rbox = {}, []

for i in range(df.shape[0]): row = list(df.iloc[i]) crgb = c, rgb = row[0], (row[3], row[4], row[5]) rbox.append(rgb) dbox.update({rgb : c}) rbox.sort()

cbox = [] for m in range(len(rbox)): cbox.append(dbox.get(rbox[m]))

fdict = {} for n in range(len(rbox)): fdict.update({cbox[n] : rbox[n]})

print(fdict)

imvickykumar999 avatar Aug 30 '20 07:08 imvickykumar999