Giter Site home page Giter Site logo

msws / colorlib-gen Goto Github PK

View Code? Open in Web Editor NEW

This project forked from c0rp3n/colorlib-gen

0.0 0.0 0.0 81 KB

A tool which generates decision trees for accelerated string lookup.

License: GNU General Public License v3.0

Shell 0.87% C++ 30.84% Python 57.35% SourcePawn 6.28% CMake 4.66%

colorlib-gen's Introduction

ColorLib - Color Generator

A tool which generates decision trees for accelerated string lookup in ColorLib.

ColorLib - Color Generator creates accelerated string lookup functions for ColorLib from a set of input colors, it creates a minimum spanning decision tree to identify any color in the input set.

The decision tree is then converted into the neccesary source code for the use case and included in one of the ColorLibs implementations.

Usage

First you need to install colorlib_gen with py ./setup.py install.

To change the output colors you first need to create a new or edit your config file.

There is an example config file provided that it is recommended you copy from it can be seen here.

Then you can rerun colorlib_gen to generate a new file containing a lookup function for your colors.

Example

# for more info use ./color_gen.py -h
colorlib_gen -re --target "sourcepawn" --config "./example_conf.yaml" colorlib_map.inc

Example GitHub workflow for SourcePawn

Note: This must executed before the plugins will be compiled.

- name: Set up Python
  uses: actions/setup-python@v2
  with:
    python-version: '3.x'

- name: Install dependencies
  run: python3 -m pip install --upgrade pip setuptools wheel

- name: Download colorlib-gen
  run: |
    cd tools
    git clone https://github.com/c0rp3n/colorlib-gen.git

- name: Install colorlib-gen
  run: |
    cd tools/colorlib-gen
    pip install -r ./requirements.txt
    python3 ./setup.py install
- name: Generate colorlib_map.inc
  run: colorlib_gen -re --target "sourcepawn" --config "./example_conf.yaml" colorlib_map.inc

Download

colorlib-gen's People

Contributors

c0rp3n avatar msws avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.