xython 4.5.7__tar.gz → 4.5.8__tar.gz
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- {xython-4.5.7/src/xython.egg-info → xython-4.5.8}/PKG-INFO +1 -1
- {xython-4.5.7 → xython-4.5.8}/pyproject.toml +1 -1
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_color.py +108 -3
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_db.py +0 -5
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_edge.py +0 -3
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_excel.py +921 -1057
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_outlook.py +3 -3
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_re.py +4 -37
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_time.py +24 -21
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_util.py +99 -36
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_word.py +13 -13
- {xython-4.5.7 → xython-4.5.8/src/xython.egg-info}/PKG-INFO +1 -1
- {xython-4.5.7 → xython-4.5.8}/MANIFEST.in +0 -0
- {xython-4.5.7 → xython-4.5.8}/README.md +0 -0
- {xython-4.5.7 → xython-4.5.8}/requirements.txt +0 -0
- {xython-4.5.7 → xython-4.5.8}/setup.cfg +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/__init__.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_auto.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_chrome.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_common.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_excel_event.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_hwp.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_list.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython/xy_map.py +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython.egg-info/SOURCES.txt +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython.egg-info/dependency_links.txt +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython.egg-info/requires.txt +0 -0
- {xython-4.5.7 → xython-4.5.8}/src/xython.egg-info/top_level.txt +0 -0
|
@@ -1510,6 +1510,81 @@ class xy_color:
|
|
|
1510
1510
|
|
|
1511
1511
|
return [R, G, B]
|
|
1512
1512
|
|
|
1513
|
+
def hsl_to_rgb(self, input_hsl):
|
|
1514
|
+
"""
|
|
1515
|
+
input_hsl을 rgb로 변경
|
|
1516
|
+
|
|
1517
|
+
:param input_hsl: [h,s,l]형식의 값
|
|
1518
|
+
:return:
|
|
1519
|
+
"""
|
|
1520
|
+
h, s, l = input_hsl
|
|
1521
|
+
|
|
1522
|
+
h = float(h / 360)
|
|
1523
|
+
s = float(s / 100)
|
|
1524
|
+
l = float(l / 100)
|
|
1525
|
+
|
|
1526
|
+
if s == 0:
|
|
1527
|
+
R = l * 255
|
|
1528
|
+
G = l * 255
|
|
1529
|
+
B = l * 255
|
|
1530
|
+
|
|
1531
|
+
if l < 0.5:
|
|
1532
|
+
temp1 = l * (1 + s)
|
|
1533
|
+
else:
|
|
1534
|
+
temp1 = l + s - l * s
|
|
1535
|
+
|
|
1536
|
+
temp2 = 2 * l - temp1
|
|
1537
|
+
|
|
1538
|
+
# h = h / 360
|
|
1539
|
+
|
|
1540
|
+
tempR = h + 0.333
|
|
1541
|
+
tempG = h
|
|
1542
|
+
tempB = h - 0.333
|
|
1543
|
+
|
|
1544
|
+
if tempR < 0: tempR = tempR + 1
|
|
1545
|
+
if tempR > 1: tempR = tempR - 1
|
|
1546
|
+
if tempG < 0: tempG = tempG + 1
|
|
1547
|
+
if tempG > 1: tempG = tempG - 1
|
|
1548
|
+
if tempB < 0: tempB = tempB + 1
|
|
1549
|
+
if tempB > 1: tempB = tempB - 1
|
|
1550
|
+
|
|
1551
|
+
if 6 * tempR < 1:
|
|
1552
|
+
R = temp2 + (temp1 - temp2) * 6 * tempR
|
|
1553
|
+
else:
|
|
1554
|
+
if 2 * tempR < 1:
|
|
1555
|
+
R = temp1
|
|
1556
|
+
else:
|
|
1557
|
+
if 3 * tempR < 2:
|
|
1558
|
+
R = temp2 + (temp1 - temp2) * (0.666 - tempR) * 6
|
|
1559
|
+
else:
|
|
1560
|
+
R = temp2
|
|
1561
|
+
|
|
1562
|
+
if 6 * tempG < 1:
|
|
1563
|
+
G = temp2 + (temp1 - temp2) * 6 * tempG
|
|
1564
|
+
else:
|
|
1565
|
+
if 2 * tempG < 1:
|
|
1566
|
+
G = temp1
|
|
1567
|
+
else:
|
|
1568
|
+
if 3 * tempG < 2:
|
|
1569
|
+
G = temp2 + (temp1 - temp2) * (0.666 - tempG) * 6
|
|
1570
|
+
else:
|
|
1571
|
+
G = temp2
|
|
1572
|
+
if 6 * tempB < 1:
|
|
1573
|
+
B = temp2 + (temp1 - temp2) * 6 * tempB
|
|
1574
|
+
else:
|
|
1575
|
+
if 2 * tempB < 1:
|
|
1576
|
+
B = temp1
|
|
1577
|
+
else:
|
|
1578
|
+
if 3 * tempB < 2:
|
|
1579
|
+
B = temp2 + (temp1 - temp2) * (0.666 - tempB) * 6
|
|
1580
|
+
else:
|
|
1581
|
+
B = temp2
|
|
1582
|
+
R = int(abs(round(R * 255, 0)))
|
|
1583
|
+
G = int(abs(round(G * 255, 0)))
|
|
1584
|
+
B = int(abs(round(B * 255, 0)))
|
|
1585
|
+
|
|
1586
|
+
return [R, G, B]
|
|
1587
|
+
|
|
1513
1588
|
def hsl_to_rgb_by_4_tetra_style(self, input_hsl):
|
|
1514
1589
|
"""
|
|
1515
1590
|
4가지 꼭지의 rgb값
|
|
@@ -1614,6 +1689,9 @@ class xy_color:
|
|
|
1614
1689
|
result = self.rgb_to_rgbint(rgb)
|
|
1615
1690
|
return result
|
|
1616
1691
|
|
|
1692
|
+
def hsl_to_rgbint(self, input_hsl):
|
|
1693
|
+
return self.hsl_to_rgbint(input_hsl)
|
|
1694
|
+
|
|
1617
1695
|
def hsv_to_rgb(self, input_hsv):
|
|
1618
1696
|
"""
|
|
1619
1697
|
HSV → RGB 변환
|
|
@@ -1664,8 +1742,8 @@ class xy_color:
|
|
|
1664
1742
|
입력된 자료의 형태가, xcolor형식인지를 확인하는 것
|
|
1665
1743
|
"""
|
|
1666
1744
|
rex = xy_re.xy_re()
|
|
1667
|
-
result1 = rex.
|
|
1668
|
-
result2 = rex.
|
|
1745
|
+
result1 = rex.is_match_all("[한글&영어:2~10][숫자:0~7]", str(input_xcolor))
|
|
1746
|
+
result2 = rex.is_match_all("[한글&영어:2~10][+-:0~7]", str(input_xcolor))
|
|
1669
1747
|
if result1:
|
|
1670
1748
|
result = result1
|
|
1671
1749
|
elif result2:
|
|
@@ -1879,7 +1957,7 @@ class xy_color:
|
|
|
1879
1957
|
|
|
1880
1958
|
if not color_dict: # 사전값이 없을때 기본으로 사전을 만드는것
|
|
1881
1959
|
color_dict = {}
|
|
1882
|
-
l1d = self.
|
|
1960
|
+
l1d = self.get_color12_kor()
|
|
1883
1961
|
for color_name in l1d:
|
|
1884
1962
|
for no in range(1, 100):
|
|
1885
1963
|
xcolor = color_name + str(no)
|
|
@@ -1977,6 +2055,9 @@ class xy_color:
|
|
|
1977
2055
|
|
|
1978
2056
|
return [int(h), int(s * 100), int(l * 100)]
|
|
1979
2057
|
|
|
2058
|
+
def rgb_to_hsl(self, input_rgb):
|
|
2059
|
+
return self.rgb_to_hsl(input_rgb)
|
|
2060
|
+
|
|
1980
2061
|
def rgb_to_hsv(self, input_rgb):
|
|
1981
2062
|
"""
|
|
1982
2063
|
RGB → HSV 변환 (포토샵 등에서 사용하는 방식)
|
|
@@ -2081,6 +2162,9 @@ class xy_color:
|
|
|
2081
2162
|
hsl = self.rgb_to_hsl(rgb)
|
|
2082
2163
|
return hsl
|
|
2083
2164
|
|
|
2165
|
+
def rgbint_to_hsl(self, input_rgbint):
|
|
2166
|
+
return self.rgbint_to_hsl(input_rgbint)
|
|
2167
|
+
|
|
2084
2168
|
def rgbint_to_rgb(self, input_rgbint):
|
|
2085
2169
|
"""
|
|
2086
2170
|
정수형태의 int값을 [r,g,b]의 리스트형태로 바꾸는 것
|
|
@@ -2093,6 +2177,9 @@ class xy_color:
|
|
|
2093
2177
|
result = [namuji1, mok1, mok0]
|
|
2094
2178
|
return result
|
|
2095
2179
|
|
|
2180
|
+
def rgbint_to_rgb(self, input_rgbint):
|
|
2181
|
+
return self.rgbint_to_rgb(input_rgbint)
|
|
2182
|
+
|
|
2096
2183
|
def rotate_hue(self, input_rgb, degrees):
|
|
2097
2184
|
"""
|
|
2098
2185
|
색상(Hue)을 degrees 만큼 회전
|
|
@@ -2250,6 +2337,12 @@ class xy_color:
|
|
|
2250
2337
|
hsl_list = self.rgbint_to_hsl(input_l1d[6])
|
|
2251
2338
|
return hsl_list
|
|
2252
2339
|
|
|
2340
|
+
def to_hsl(self, input_xcolor):
|
|
2341
|
+
"""
|
|
2342
|
+
사용의 편의성을 위해 만듦
|
|
2343
|
+
"""
|
|
2344
|
+
return self.to_hsl(input_xcolor)
|
|
2345
|
+
|
|
2253
2346
|
def to_hsl(self, input_xcolor):
|
|
2254
2347
|
"""
|
|
2255
2348
|
입력된 자료를 기준으로 hsl값을 돌려주는것
|
|
@@ -2308,6 +2401,12 @@ class xy_color:
|
|
|
2308
2401
|
result.append(temp)
|
|
2309
2402
|
return result
|
|
2310
2403
|
|
|
2404
|
+
def to_rgb(self, input_xcolor):
|
|
2405
|
+
"""
|
|
2406
|
+
사용의 편의성을 위해 만듦
|
|
2407
|
+
"""
|
|
2408
|
+
return self.to_rgb(input_xcolor)
|
|
2409
|
+
|
|
2311
2410
|
def to_rgb(self, input_xcolor):
|
|
2312
2411
|
"""
|
|
2313
2412
|
xcolor값을 rgb값으로 변경
|
|
@@ -2488,6 +2587,12 @@ class xy_color:
|
|
|
2488
2587
|
result.append(1.0)
|
|
2489
2588
|
return result
|
|
2490
2589
|
|
|
2590
|
+
def to_rgbint(self, input_xcolor):
|
|
2591
|
+
"""
|
|
2592
|
+
사용의 편의성을 위해 만듦
|
|
2593
|
+
"""
|
|
2594
|
+
return self.to_rgbint(input_xcolor)
|
|
2595
|
+
|
|
2491
2596
|
def to_rgbint(self, input_xcolor):
|
|
2492
2597
|
"""
|
|
2493
2598
|
xcolor값을 rgbint로 변경
|
|
@@ -57,11 +57,6 @@ class xy_db:
|
|
|
57
57
|
input_l2d.append(line_data)
|
|
58
58
|
return input_l2d
|
|
59
59
|
|
|
60
|
-
def append_df1_in_df2(self, df_obj_1, df_obj_2):
|
|
61
|
-
#dataframe의 끝에 dataframe으로 만든 것을 맨끝에 추가하는것
|
|
62
|
-
df_obj_1 = pd.concat([df_obj_1, df_obj_2])
|
|
63
|
-
return df_obj_1
|
|
64
|
-
|
|
65
60
|
def change_any_data_to_dic(self, input_1, input_2=""):
|
|
66
61
|
"""
|
|
67
62
|
입력되는 자료가 어떤 자료형태라도 사전형식으로 만드는 것
|