All Projects → dmilos → color

dmilos / color

Licence: Apache-2.0 license
C++ library thats implemets class color. Available models: RGB, HSL, HSV, CMY, CMYK, YIQ, YUV and growing.

Programming Languages

C++
36643 projects - #6 most used programming language
Batchfile
5799 projects
shell
77523 projects

Projects that are alternatives of or similar to color

rgb-tui
Create and get colors code from the terminal using a nice interface.
Stars: ✭ 57 (-59.86%)
Mutual labels:  color
jsoncolor
Colorized JSON output for Go
Stars: ✭ 27 (-80.99%)
Mutual labels:  color
rebass
⚛️ React primitive UI components built with styled-system.
Stars: ✭ 7,844 (+5423.94%)
Mutual labels:  color
nord-atom-syntax
An arctic, north-bluish clean and elegant Atom syntax theme.
Stars: ✭ 72 (-49.3%)
Mutual labels:  color
colorscale
Create a color scale from a single color
Stars: ✭ 80 (-43.66%)
Mutual labels:  color
quickpalette
🏃‍♀️🎨 R package for quick extraction of color palettes from text and images
Stars: ✭ 24 (-83.1%)
Mutual labels:  color
theme-ui-native
Build consistent, themeable React Native apps based on constraint-based design principles
Stars: ✭ 67 (-52.82%)
Mutual labels:  color
hcv-color
🌈 Color model HCV/HCG is an alternative to HSV and HSL, derived by Munsell color system, usable for Dark and Light themes... 🌈
Stars: ✭ 44 (-69.01%)
Mutual labels:  color
Giotto
Theme manager for your app: apply styles to anything you want through a plist file
Stars: ✭ 18 (-87.32%)
Mutual labels:  color
sprout
Golang logging library supporting log retrieval.
Stars: ✭ 85 (-40.14%)
Mutual labels:  color
goterminal
A cross-platform Go-library for updating progress in terminal.
Stars: ✭ 56 (-60.56%)
Mutual labels:  color
ViewColorGenerator
A library to generate color palette for view, imageview and image from URL.
Stars: ✭ 29 (-79.58%)
Mutual labels:  color
ColorByNumber-iOS
Color by Number: a pixel coloring game on iOS.
Stars: ✭ 50 (-64.79%)
Mutual labels:  color
odak
🔬 Scientific computing library for optics 🔭, computer graphics 💻 and visual perception 👀
Stars: ✭ 99 (-30.28%)
Mutual labels:  color
Chalk
✏️Expressive styling on terminal string. (chalk for swift)
Stars: ✭ 59 (-58.45%)
Mutual labels:  color
react-native-image-color-picker
Image color picker based on image source provided and return image different color palettes or average color palette
Stars: ✭ 25 (-82.39%)
Mutual labels:  color
nxColor
Haxe color manipulation library.
Stars: ✭ 38 (-73.24%)
Mutual labels:  color
colr pickr
Colr Pickr, a vanilla JavaScript color picker component built with SVGs, with features like saving colors. Similar design to the chrome-dev-tools color picker.
Stars: ✭ 27 (-80.99%)
Mutual labels:  color
strip-ansi-stream
Strip ANSI escape codes
Stars: ✭ 32 (-77.46%)
Mutual labels:  color
SwiftColorWheel
Delightful color picker wheel for iOS in Swift.
Stars: ✭ 37 (-73.94%)
Mutual labels:  color

Yet another c++ library that implements color.

Description

  • Yet another c++ library that implements color conversion and manipulation.

Key features:

  • No virtual functions
  • Minimal memory footprint
  • Ability to copy array/vector of colors with memcpy, memmove and initialize with memset.
  • Conversions from/to different models ( and its formats ).
  • Headers only
    • One file to include to start the fun
    • By using del or rm it is reducible in to only two of them.
  • No third parties
  • No additional binaries
  • Out of the box ready
    • No need to recompile or start some install process.
  • Color models:
    • GRAY,
    • RGB, CMY, CMYK,
    • HSI, HSL, HSV, HWB,
    • YIQ, YUV(BT.601, BT.709), YCgCo, YPbPr(BT.601, BT.709, BT.2020),
    • XYZ( sRGB, D65, 2° ), LAB( CIE, Hunter), LUV, LMS( von Kries D65, von Kries E, BFD, MCAT02 ), xyY, LabCH, LuvCH

Code sample - Initialization:

// Initialize with constant.
color::bgr<std::uint8_t>  b( ::color::constant::aqua_t{} );

//!< Use x11 green.
color::yiq<std::uint8_t>  y( ::color::constant::x11::green_t{} );

// Use intuitive/natural values for initialization.
// hue goes from 0 to 360, saturation and value from 0 to 100.
color::hsv<double>        h( { 120.0, 50.0, 60.0 } );

// Lightens will goes from 0 to 100. a and b from -127 to 127.
color::lab<float>         l( { 50.0, -10, 90 } );

// Well known rgb. Values are between 0 and 1.
color::rgb<float>         r( { 0.5, 0, 0.9 } );

Code sample - Conversion:

// any model/format to any model/format by use of operator=

b = r; //!< Reformat and convert.
r = b; //!< Reformat and convert in opposite direction.
h = b; //!< Reformat and convert from bgr<std::uint8_t> to hsv<double>
h = y; //!< Reformat and convert from yiq<std::uint8_t> to hsv<double>
l = y; //!< Reformat and convert from yiq<std::uint8_t> to lab<float>

Code sample - Feature Extraction:

color::rgb<std::uint8_t>  r = ::color::constant::aqua_t{};
::color::get::red( r ); //!< Extract red

color::yiq<std::uint8_t>  y = ::color::constant::orange_t{};
::color::get::red( y ); //!< Extract red

Code sample - Distance:

using namespace std;
using namespace color;
using namespace color::operation;
using namespace color::constant;
using namespace color::constant::distance;

rgb<uint8_t>  r0 = aqua_t{};
rgb<uint8_t>  r1 = turquoise_t{};
yiq<uint8_t>  y  = orange_t{};

cout << distance< euclid_entity  >( r0, r1 ) << endl;
cout << distance< CIE76_entity >( r0, y ) << endl;
cout << distance< CIE94_graphics_entity >( r0, y ) << endl;
cout << distance< CIE94_textile_entity >( r0, y ) << endl;
cout << distance< CIEDE2000_entity >( r0, y ) << endl;
cout << distance< CMC1984_entity >( r0, y, 1, 2 ) << endl;
cout << distance< delta_gray_entity >( r0, r1 ) << endl;

Code sample - Blending:

color::yiq<std::uint8_t>  y1 = ::color::constant::turquoise_t{};
color::yiq<std::uint8_t>  y2 = ::color::constant::orange_t{};
color::yiq<std::uint8_t>  yr;

::color::operation::blend(  y1, 0.1, y2 ); //!< Blend two colors for given alpha. Accumulation style.
yr = color::operation::mix( y2, 0.5, y2 ); //!< Blend two colors for given alpha. return style.

Install:

  1. Clone this Repository:
    Examples:
  2. Inform compiler where to find headers:
    Examples:
    • MSVC : /Ic:\my-work-folder\my-git-folder\color\src
    • gcc : -I/home/my-user-name/my-work-folder/my-git-folder/color/src

Want to see more:

Tested against:

  • GCC 7.3.0
  • GCC 10.2.0
  • MSVC 2015 Update 3
  • MSVC 2017 15.9.28
  • MSVC 2019 16.8.3

License

Licensed under an Apache-2.0 license.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].