Skip to content

Commit

Permalink
v2.7.26
Browse files Browse the repository at this point in the history
  • Loading branch information
eigenmiao committed Apr 9, 2023
1 parent 3ddb798 commit d0693a1
Show file tree
Hide file tree
Showing 67 changed files with 282 additions and 252 deletions.
10 changes: 10 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,3 +55,13 @@
5. Switch to PySide2 to reduce the installation package size.
6. Make the stab col in depot view change with the size of interface.
8. Add image record in desc.

# v2.7.26
* Date: April 9, 2023
* Tag: https://github.com/eigenmiao/Rickrack/releases/tag/v2.7.26
* Comments:
1. Fix close error in the Rickrack module.
2. Update sequence of menu list.
3. Switch to PyQt5 for some unknown bugs in PySide2.
4. When determining the region, redirect Esperanto ("eo") to English ("en") because Esperanto is not a dialect of any region.
5. Update languages.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,12 +11,12 @@ Generate Harmonious Colors Freely.<br/>自由自在生成和谐色彩。
# Rickrack
In the age of digital creativity, the color palette has become an indispensable tool for designers. A good color palette can make a design more attractive and coordinated. Rickrack is designed for you if you are looking for an excellent color palette software! Rickrack has various color mixing functions and is suitable for various scenes. Rickrack is easy to use, and more importantly, it's completely free without networking or registration required.

Rickrack (**R**e**a**l-t**i**me **C**olor **K**it) is a free and user-friendly color editor. It is designed to generate a set of harmonious colors from the color wheel or other places. You can share these colors with your friends, or apply them into your creative works.
Rickrack (**R**e**a**l-t**i**me **C**olor **K**it) is a free and user-friendly color editor. It is designed to generate a set of harmonious colors from the color wheel or other places. You can share these colors with your friends, or apply them into your creative works. What’s more, you can export them into individual files and import them into other softwares such as Adobe Photoshop, GIMP, Krita, Pencil 2D and Clip Studio Paint. Rickrack can run normally on operating systems such as Windows, Linux, and macOS.

# 焰火十二卷
在数字创意的时代,调色板成为了设计师不可或缺的工具。一个好的调色板可以让设计更加有吸引力和协调性。如果你正在寻找一款优秀的调色板软件,那就试试焰火十二卷吧!焰火十二卷具有多种配色功能,适用于多种场景。焰火十二卷简单易上手,更重要的是,它完全免费,无需联网或注册。

焰火十二卷(实时色彩工具箱)是一款免费且实用的色彩编辑器。它可以帮助你从色轮或者其他地方生成一组和谐的色彩。你可以将这些色彩分享给其他人,或者应用到你自己的创作当中。
焰火十二卷(实时色彩工具箱)是一款免费且实用的色彩编辑器。它可以帮助你从色轮或者其他地方生成一组和谐的色彩。你可以将这些色彩分享给其他人,或者应用到你自己的创作当中。此外,你也可以将色彩组或者色彩仓库导出为单独的色彩文档并导入其他软件中(如 Adobe Photoshop、GIMP、Krita、Pencil 2D 以及优动漫 Paint 等)。焰火十二卷可以在 Windows、Linux、macOS 等操作系统上正常运行。

# Table of Content
* [Feature](#feature)
Expand Down Expand Up @@ -124,7 +124,7 @@ https://github.com/eigenmiao/Rickrack

# Installation
## Current Release
The latest preview version is [v2.7.25](https://github.com/eigenmiao/Rickrack/releases/tag/v2.7.25).
The latest preview version is [v2.7.26](https://github.com/eigenmiao/Rickrack/releases/tag/v2.7.26).

## Install Software
### Recommend: Install on Windows 10 or 11 via WinGet tool
Expand All @@ -133,7 +133,7 @@ winget install rickrack
```

## Install on other platforms
Download Software from [Github](https://github.com/eigenmiao/Rickrack/releases/tag/v2.7.25) or [Sourceforge](https://sourceforge.net/projects/rickrack/files/v2.7.25/). The installation steps are presented in [tutorials](https://eigenmiao.com/2021/12/12/rickrack-tutorial-en-v2.3.4/#Installation).
Download Software from [Github](https://github.com/eigenmiao/Rickrack/releases/tag/v2.7.26) or [Sourceforge](https://sourceforge.net/projects/rickrack/files/v2.7.26/). The installation steps are presented in [tutorials](https://eigenmiao.com/2021/12/12/rickrack-tutorial-en-v2.3.4/#Installation).

Here is a [video tutorial](https://www.bilibili.com/video/BV17r4y1L7R6/).

Expand Down
3 changes: 2 additions & 1 deletion SECURITY.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@ These versions of Rickrack are currently being supported with security updates.

| Version | Supported |
| --------------------- | ------------------ |
| v2.7.25-x2d3s3-stable | :white_check_mark: |
| v2.7.26-x2d3s3-stable | :white_check_mark: |
| v2.7.25-x2d3s3-stable | :x: |
| v2.7.23-x2d3s3-pre | :x: |
| v2.6.6-x2d2s2-pre | :x: |
| v2.6.5-x2d2s2-pre | :x: |
Expand Down
73 changes: 36 additions & 37 deletions rickrack/result.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
Copyright (c) 2019-2023 by Eigenmiao. All Rights Reserved.
"""

import numpy as np
from rickrack.color import Color


Expand Down Expand Up @@ -82,10 +83,10 @@ def __init__(self, color_grid, name_grid, grid_size):
"""

if not isinstance(color_grid, (tuple, list)):
raise ValueError("Invalid color grid: {}".format(color_grid))
raise ValueError("Color grid is not a list: {}".format(color_grid))

if not isinstance(name_grid, (tuple, list)):
raise ValueError("Invalid name grid: {}".format(name_grid))
raise ValueError("Name grid is not a list: {}".format(name_grid))

if isinstance(grid_size, int) and grid_size >= 0:
self._grid_size = (int(grid_size),)
Expand All @@ -97,15 +98,18 @@ def __init__(self, color_grid, name_grid, grid_size):
self._grid_size = (int(grid_size[0]), int(grid_size[1]))

else:
raise ValueError("Invalid grid size: {}".format(grid_size))
raise ValueError("Grid size is not a number list: {}".format(grid_size))

if len(self._grid_size) == 1:
self._color_grid = ["FFFFFF" if i >= len(color_grid) else str(color_grid[i]) for i in range(self._grid_size[0])]
self._name_grid = ["RR-{}".format(i + 1) if i >= len(name_grid) else str(name_grid[i]) for i in range(self._grid_size[0])]
color_grid = ["FFFFFF" if i >= len(color_grid) else Color.fmt_hec(color_grid[i]) for i in range(self._grid_size[0])]
name_grid = ["RR-{}".format(i + 1) if i >= len(name_grid) else str(name_grid[i]) for i in range(self._grid_size[0])]

else:
self._color_grid = [["FFFFFF" if i * self._grid_size[1] + j >= len(color_grid) else str(color_grid[i * self._grid_size[1] + j]) for j in range(self._grid_size[1])] for i in range(self._grid_size[0])]
self._name_grid = [["RR-{}-{}".format(i + 1, j + 1) if i * self._grid_size[1] + j >= len(name_grid) else str(name_grid[i * self._grid_size[1] + j]) for j in range(self._grid_size[1])] for i in range(self._grid_size[0])]
color_grid = [["FFFFFF" if i * self._grid_size[1] + j >= len(color_grid) else Color.fmt_hec(color_grid[i * self._grid_size[1] + j]) for j in range(self._grid_size[1])] for i in range(self._grid_size[0])]
name_grid = [["RR-{}-{}".format(i + 1, j + 1) if i * self._grid_size[1] + j >= len(name_grid) else str(name_grid[i * self._grid_size[1] + j]) for j in range(self._grid_size[1])] for i in range(self._grid_size[0])]

self._color_grid = np.array(color_grid, dtype=str).reshape(grid_size)
self._name_grid = np.array(name_grid, dtype=str).reshape(grid_size)

# ---------- ---------- ---------- Inner Funcs ---------- ---------- ---------- #

Expand All @@ -120,11 +124,15 @@ def __getitem__(self, idx):
curr_color = self._color_grid[idx]
curr_name = self._name_grid[idx]

if isinstance(curr_color, str):
if isinstance(curr_color, str) and isinstance(curr_name, str):
return Box(curr_color, curr_name)

else:
return Grid(curr_color, curr_name, len(curr_color))
elif isinstance(curr_color, np.ndarray) and isinstance(curr_name, np.ndarray):
curr_size = curr_color.shape
curr_color = curr_color.reshape(-1).tolist()
curr_name = curr_name.reshape(-1).tolist()

return Grid(curr_color, curr_name, curr_size)

def __str__(self):
"""
Expand All @@ -144,53 +152,44 @@ def __repr__(self):

@property
def T(self):
if len(self.size) == 1:
return Grid(self._color_grid, self._name_grid, self.size)
curr_color = self._color_grid.T
curr_name = self._name_grid.T

else:
return Grid(*self.v_line.grid.values, (self.size[1], self.size[0]))
curr_size = curr_color.shape
curr_color = curr_color.reshape(-1).tolist()
curr_name = curr_name.reshape(-1).tolist()

return Grid(curr_color, curr_name, curr_size)

@property
def size(self):
return self._grid_size

@property
def shape(self):
return self.size

@property
def values(self):
return tuple(self._color_grid), tuple(self._name_grid)
return self._color_grid.reshape(-1).tolist(), self._name_grid.reshape(-1).tolist()

@property
def grid(self):
return Grid(*self.h_line.values, self.size)

@property
def h_line(self):
if len(self.size) == 1:
return Grid(self._color_grid, self._name_grid, self.size)
curr_color = self._color_grid.reshape(-1).tolist()
curr_name = self._name_grid.reshape(-1).tolist()

else:
color_grid = []
name_grid = []

for i in range(self.size[0]):
color_grid += self._color_grid[i]
name_grid += self._name_grid[i]

return Grid(color_grid, name_grid, self.size[0] * self.size[1])
return Grid(curr_color, curr_name, len(curr_color))

@property
def v_line(self):
if len(self.size) == 1:
return Grid(self._color_grid, self._name_grid, self.size)

else:
color_grid = []
name_grid = []

for j in range(self.size[1]):
color_grid += [self._color_grid[i][j] for i in range(self.size[0])]
name_grid += [self._name_grid[i][j] for i in range(self.size[0])]
curr_color = self._color_grid.T.reshape(-1).tolist()
curr_name = self._name_grid.T.reshape(-1).tolist()

return Grid(color_grid, name_grid, self.size[0] * self.size[1])
return Grid(curr_color, curr_name, len(curr_color))


class Result(object):
Expand Down
40 changes: 29 additions & 11 deletions rickrack/rickrack.py
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,15 @@
"""

__VERSION__ = """
v2.7.25-x2d3s3-stable
v2.7.26-x2d3s3-stable
"""

__AUTHOR__ = """
Eigenmiao ([email protected])
"""

__DATE__ = """
March 12, 2023
April 9, 2023
"""

__HELP__ = """
Expand Down Expand Up @@ -372,6 +372,26 @@ def colors_in_order(self):
def selected_color(self):
return self._result.selected_color

@property
def full_colors(self):
return self._result.full_colors

@property
def color_grid(self):
return self._result.color_grid

@property
def cset(self):
return self._result.cset

@property
def cset_in_order(self):
return self._result.cset_in_order

@property
def refs(self):
return self._result.refs

@property
def grid(self):
return self._result.grid
Expand All @@ -391,7 +411,6 @@ def is_connected(self):
"""

if not self._port:
self.is_started_by_script = False
return False

try:
Expand All @@ -403,7 +422,6 @@ def is_connected(self):

except Exception as err:
print("Connect to server with port {} faild:\n{}".format(self._port, err))
self.is_started_by_script = False
return False

return True
Expand Down Expand Up @@ -903,16 +921,16 @@ def close(self, save_data=True):
"""

if self.is_started_by_script and self.is_connected:
client = socket.socket()
client.settimeout(self._timeout)
client.connect((self._host, self._port))
while self.is_connected:
client = socket.socket()
client.settimeout(self._timeout)
client.connect((self._host, self._port))

info = "exit{}".format(save_data)
client.sendall(info.encode("utf-8"))
info = "exit{}".format(save_data)
client.sendall(info.encode("utf-8"))

client.close()
client.close()

while self.is_connected:
time.sleep(1)
print("Waiting for closing Rickrack.")

Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@

setup(
name="Rickrack",
version="2.7.25",
version="2.7.26",
author="Eigenmiao",
author_email="[email protected]",
description="Generate harmonious colors freely.",
Expand Down
2 changes: 1 addition & 1 deletion src/build/settings/base.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,5 @@
"app_name": "Rickrack",
"author": "Eigenmiao",
"main_module": "src/main/python/main.py",
"version": "2.7.25"
"version": "2.7.26"
}
2 changes: 1 addition & 1 deletion src/main/icons/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Rickrack](full/icon_full_128.png)

[中文](https://eigenmiao.com/yanhuo/zh.html) | [English](https://eigenmiao.com/yanhuo/en.html) | [日本語](https://eigenmiao.com/yanhuo/ja.html)
[中文](https://eigenmiao.com/yanhuo/) | [English](https://eigenmiao.com/rickrack/)

This directory contains the icons that are displayed for [Rickrack](https://github.com/eigenmiao/Rickrack).

Expand Down
2 changes: 1 addition & 1 deletion src/main/icons/resource/README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
![Haworthia the Firework](icon_full_128.png)

[中文](https://eigenmiao.com/yanhuo/zh.html) | [English](https://eigenmiao.com/yanhuo/en.html) | [日本語](https://eigenmiao.com/yanhuo/ja.html)
[中文](https://eigenmiao.com/yanhuo/) | [English](https://eigenmiao.com/rickrack/)

This directory contains resource images required by [Rickrack](https://github.com/eigenmiao/Rickrack).

Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/design/box_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Form implementation generated from reading ui file 'src\main\python\cguis\design\box_dialog.ui'
#
# Created by: PySide2 UI code generator 5.12.1
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_BoxDialog(object):
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/design/info_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Form implementation generated from reading ui file 'src\main\python\cguis\design\info_dialog.ui'
#
# Created by: PySide2 UI code generator 5.12.1
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_InfoDialog(object):
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/design/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Form implementation generated from reading ui file 'src\main\python\cguis\design\main_window.ui'
#
# Created by: PySide2 UI code generator 5.12.1
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_MainWindow(object):
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/design/scroll_cube.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Form implementation generated from reading ui file 'src\main\python\cguis\design\scroll_cube.ui'
#
# Created by: PySide2 UI code generator 5.12.1
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_ScrollCube(object):
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/design/settings_dialog.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Form implementation generated from reading ui file 'src\main\python\cguis\design\settings_dialog.ui'
#
# Created by: PySide2 UI code generator 5.12.1
# Created by: PyQt5 UI code generator 5.12.1
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore, QtGui, QtWidgets
from PyQt5 import QtCore, QtGui, QtWidgets


class Ui_SettingsDialog(object):
Expand Down
4 changes: 2 additions & 2 deletions src/main/python/cguis/resource/view_rc.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

# Resource object code
#
# Created by: The Resource Compiler for PySide2 (Qt v5.12.2)
# Created by: The Resource Compiler for PyQt5 (Qt v5.12.2)
#
# WARNING! All changes made in this file will be lost!

from PySide2 import QtCore
from PyQt5 import QtCore

qt_resource_data = b"\
\x00\x00\x09\xd3\
Expand Down
Loading

0 comments on commit d0693a1

Please sign in to comment.