/* -*- Objc -*- */ /* * $Id: ColorAlpha.h,v 1.1 2003/09/12 14:39:11 ano Exp $ * * Copyright (C) 2003 Free Software Foundation, Inc. * * This file is part of GNU Hégémonie. * * This program is free software; you can redistribute it and/or * modify it under the terms of the GNU General Public License * as published by the Free Software Foundation; either version 2 * of the License, or (at your option) any later version. * * This program is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with this program; if not, write to the Free Software * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. */ #ifndef COLOR_ALPHA_H #define COLOR_ALPHA_H #include "Common/Types.h" typedef struct { clamp_t red, green, blue, alpha; } color_alpha_t; static inline color_alpha_t MakeColorAlpha (clamp_t red, clamp_t green, clamp_t blue, clamp_t alpha) { color_alpha_t color; color.red = red; color.green = green; color.blue = blue; color.alpha = alpha; return color; } #define __DEFINE_ALPHA_COLOR(_name,_red,_blue,_green,_alpha) \ static const color_alpha_t _name __attribute__((unused)) \ = {(_red), (_blue), (_green), (_alpha)} __DEFINE_ALPHA_COLOR(white, 1.0f, 1.0f, 1.0f, 1.0f); __DEFINE_ALPHA_COLOR(black, 0.0f, 0.0f, 0.0f, 1.0f); __DEFINE_ALPHA_COLOR(red, 1.0f, 0.0f, 0.0f, 1.0f); __DEFINE_ALPHA_COLOR(green, 0.0f, 1.0f, 0.0f, 1.0f); __DEFINE_ALPHA_COLOR(blue, 0.0f, 0.0f, 1.0f, 1.0f); __DEFINE_ALPHA_COLOR(yellow, 1.0f, 1.0f, 0.0f, 1.0f); __DEFINE_ALPHA_COLOR(magenta, 1.0f, 0.0f, 1.0f, 1.0f); __DEFINE_ALPHA_COLOR(cyan, 0.0f, 1.0f, 1.0f, 1.0f); __DEFINE_ALPHA_COLOR(brown, 0.6f, 0.4f, 0.2f, 1.0f); __DEFINE_ALPHA_COLOR(darkGray, 1.0f/3.0f, 1.0f/3.0f, 1.0f/3.0f, 1.0f); __DEFINE_ALPHA_COLOR(lightGray, 2.0f/3.0f, 2.0f/3.0f, 2.0f/3.0f, 1.0f); __DEFINE_ALPHA_COLOR(orange, 1.0f, 0.5f, 0.0f, 1.0f); __DEFINE_ALPHA_COLOR(purple, 0.5f, 0.0f, 0.5f, 1.0f); #undef __DEFINE_ALPHA_COLOR #endif /* COLOR_ALPHA_H */