alistair
4 years ago
5 changed files with 6 additions and 39 deletions
@ -0,0 +1,3 @@
@@ -0,0 +1,3 @@
|
||||
[submodule "c-colours"] |
||||
path = c-colours |
||||
url = git@topost.net:alistair/c-colours.git |
@ -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,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…
Reference in new issue