diff --git a/.gitignore b/.gitignore index 59fd4b3..92246ac 100644 --- a/.gitignore +++ b/.gitignore @@ -11,4 +11,4 @@ build/ dist/ draft/ Makefile -perception-default/ \ No newline at end of file +segancha-default/ \ No newline at end of file diff --git a/CMakeLists.txt b/CMakeLists.txt index 4666830..083949f 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -1,6 +1,6 @@ cmake_minimum_required (VERSION 3.1) -project(perception) +project(segancha) set(CMAKE_CXX_STANDARD 11) set(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -Wall -Wconversion -Wno-unused-private-field -Wno-unused-variable -Wno-unused-parameter -fno-omit-frame-pointer -fsanitize=address") @@ -21,24 +21,24 @@ set_target_properties(native PROPERTIES SUFFIX "${PYTHON_MODULE_EXTENSION}") if(CMAKE_BUILD_TYPE MATCHES "Debug") - add_library(perception SHARED ${LIB_SOURCES}) - target_include_directories(perception PUBLIC include) + add_library(segancha SHARED ${LIB_SOURCES}) + target_include_directories(segancha PUBLIC include) add_executable(testevo1 test/example1.cpp) - target_link_libraries(testevo1 perception) + target_link_libraries(testevo1 segancha) add_executable(testevo2 test/example2.cpp) - target_link_libraries(testevo2 perception) + target_link_libraries(testevo2 segancha) add_executable(testlexi test/testlexi.cpp) - target_link_libraries(testlexi perception) + target_link_libraries(testlexi segancha) add_executable(testCIEDE2000 test/testCIEDE2000.cpp) - target_link_libraries(testCIEDE2000 perception) + target_link_libraries(testCIEDE2000 segancha) add_executable(testcolorspace test/testcolorspace.cpp) - target_link_libraries(testcolorspace perception) + target_link_libraries(testcolorspace segancha) add_executable(testfitness test/testfitness.cpp) - target_link_libraries(testfitness perception) + target_link_libraries(testfitness segancha) add_executable(testfitness2 test/testfitness2.cpp) - target_link_libraries(testfitness2 perception) + target_link_libraries(testfitness2 segancha) endif(CMAKE_BUILD_TYPE MATCHES "Debug") diff --git a/README.md b/README.md index 1fb7d0a..52a697f 100644 --- a/README.md +++ b/README.md @@ -1,20 +1,20 @@ -# Perception +# Segancha A Python3 library with CLI that generates the optimal discernible color palette for theme building. ## Installation and Usage - pip3 install https://github.com/gywn/perception/archive/v0.0.2.tar.gz + pip3 install https://github.com/gywn/segancha/archive/v0.0.2.tar.gz Generate demo page - perception --profile demo - cd ./perception-default/demo/ + segancha --profile demo + cd ./segancha-default/demo/ Generate warm & dark theme extension for VSCode - perception --name warm-and-dark --temperature 4500 --background 15 --profile vscode - rsync -a ./perception-warm-and-dark/vscode/ ~/.vscode/extensions/ + segancha --name warm-and-dark --temperature 4500 --background 15 --profile vscode + rsync -a ./segancha-warm-and-dark/vscode/ ~/.vscode/extensions/ ## Aknowladgement diff --git a/include/fitness.h b/include/fitness.h index 39a401c..3db3c9c 100644 --- a/include/fitness.h +++ b/include/fitness.h @@ -22,7 +22,7 @@ double offChroma(const color::LCH &lch, double C); LexiProduct fitnessFunc(const std::vector &lab, size_t M = 0, double maxC = -1.); -struct PerceptionResult { +struct SeganchaResult { unsigned long flags; double L; double maxC; @@ -30,9 +30,9 @@ struct PerceptionResult { std::vector rgb; LexiProduct fitness; }; -using PerceptionResult = struct PerceptionResult; +using SeganchaResult = struct SeganchaResult; -std::ostream &operator<<(std::ostream &os, const PerceptionResult &res); +std::ostream &operator<<(std::ostream &os, const SeganchaResult &res); /* * @param M numbers of free colors @@ -40,10 +40,10 @@ std::ostream &operator<<(std::ostream &os, const PerceptionResult &res); * @param maxC maximal chroma, < 0 to be ignored * @param fixed vector of fixed colors, optional * @param quiet don't write info to stdout - * @return PerceptionResult + * @return SeganchaResult */ -PerceptionResult perception(size_t M, double L = -1, double maxC = -1, - std::vector const *fixed = nullptr, - bool quiet = false); +SeganchaResult segancha(size_t M, double L = -1, double maxC = -1, + std::vector const *fixed = nullptr, + bool quiet = false); color::LCH maxChroma(const color::LCH &lch, double maxC = -1); diff --git a/python/cli.py b/python/cli.py index ad08d94..0c91689 100644 --- a/python/cli.py +++ b/python/cli.py @@ -8,13 +8,13 @@ def argparser(): ps = ArgumentParser( - prog='perception', + prog='segancha', description=dedent(""" Generate optimized discernible color palette and themes settings Example: - perception --temperature -1 --profile demo - perception --background 97 --profile vscode + segancha --temperature -1 --profile demo + segancha --background 97 --profile vscode """), formatter_class=RawDescriptionHelpFormatter) diff --git a/python/data/demo/perception-{{name}}-demo.html.mustache b/python/data/demo/segancha-{{name}}-demo.html.mustache similarity index 97% rename from python/data/demo/perception-{{name}}-demo.html.mustache rename to python/data/demo/segancha-{{name}}-demo.html.mustache index 53e462d..63ef13d 100644 --- a/python/data/demo/perception-{{name}}-demo.html.mustache +++ b/python/data/demo/segancha-{{name}}-demo.html.mustache @@ -2,7 +2,7 @@ - Perception Theme - {{name}} | Demo + Segancha Theme - {{name}} | Demo