Browse Source

link col lib

dev
alistair 4 years ago
parent
commit
8988d6c354
  1. 3
      .gitmodules
  2. 2
      Makefile
  3. 1
      c-colours
  4. 2
      colcat.c
  5. 37
      colcat.h

3
.gitmodules vendored

@ -0,0 +1,3 @@ @@ -0,0 +1,3 @@
[submodule "c-colours"]
path = c-colours
url = git@topost.net:alistair/c-colours.git

2
Makefile

@ -1,5 +1,5 @@ @@ -1,5 +1,5 @@
default: colcat.c colcat.h
gcc -c colcat.c -o bin/colcat.o
gcc -c colours/colours.c -o bin/colours.o
gcc -c c-colours/colours.c -o bin/colours.o
gcc -lm bin/colcat.o bin/colours.o -o bin/colcat

1
c-colours

@ -0,0 +1 @@ @@ -0,0 +1 @@
Subproject commit e2078d705069515d84b934c92ff99f55add77036

2
colcat.c

@ -1,4 +1,4 @@ @@ -1,4 +1,4 @@
#include "colours/colours.h"
#include "c-colours/colours.h"
#include <getopt.h>
#include <stdbool.h>

37
colcat.h

@ -1,37 +0,0 @@ @@ -1,37 +0,0 @@
#include <stdbool.h>
#include <stdlib.h>
#include <string.h>
#include <math.h>
#include <stdio.h>
#ifndef H_COLOURS
#define H_COLOURS
enum colour_space {
CS_RGB = 0, // default to RGB
CS_HSV = 1,
CS_HSL = 2,
};
struct colour {
double h;
double s;
double v;
double l;
int r;
int g;
int b;
enum colour_space sp;
};
// doesn't support hsl-hsv or converse, conversion
struct colour get_hsl(struct colour c);
struct colour get_hsv(struct colour c);
struct colour get_rgb(struct colour c);
struct colour *get_adjacent(struct colour base, int deg, int num);
void print_colour(struct colour c);
#endif
Loading…
Cancel
Save