You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

61 lines
857 B

14 years ago
//
// color.h
//
// Copyright (c) 2010 LearnBoost <tj@learnboost.com>
//
14 years ago
#ifndef __COLOR_PARSER_H__
#define __COLOR_PARSER_H__
14 years ago
#include <stdio.h>
14 years ago
#include <stdint.h>
#include <string.h>
/*
* RGBA struct.
*/
typedef struct {
double r, g, b, a;
} rgba_t;
14 years ago
/*
14 years ago
* Prototypes.
*/
rgba_t
14 years ago
rgba_create(uint32_t rgba);
14 years ago
14 years ago
inline int32_t
14 years ago
rgba_from_rgba(uint8_t r, uint8_t g, uint8_t b, uint8_t a);
14 years ago
int32_t
14 years ago
rgba_from_rgb(uint8_t r, uint8_t g, uint8_t b);
14 years ago
int32_t
14 years ago
rgba_from_hex6_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_hex3_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_rgb_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_rgba_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_hex_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_name_string(const char *str);
14 years ago
int32_t
14 years ago
rgba_from_string(const char *str);
14 years ago
void
14 years ago
rgba_inspect(int32_t rgba);
14 years ago
#endif /* __COLOR_PARSER_H__ */