
00001 /*************************************************************************** 00002 * Copyright (C) 2006 by Rick L. Vinyard, Jr. * 00003 * rvinyard@cs.nmsu.edu * 00004 * * 00005 * This file is part of the papyrus library. * 00006 * * 00007 * papyrus is free software; you can redistribute it and/or modify * 00008 * it under the terms of the GNU Lesser General Public License * 00009 * version 3.0 as published by the Free Software Foundation. * 00010 * * 00011 * papyrus is distributed in the hope that it will be useful, * 00012 * but WITHOUT ANY WARRANTY; without even the implied warranty of * 00013 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * 00014 * GNU Lesser General Public License version 3.0 for more details. * 00015 * * 00016 * You should have received a copy of the GNU Lesser General Public * 00017 * License along with the papyrus library. If not, see * 00018 * <http://www.gnu.org/licenses/>. * 00019 ***************************************************************************/ 00020 #ifndef PAPYRUSHSLA_H 00021 #define PAPYRUSHSLA_H 00022 00023 namespace Papyrus 00024 { 00025 00026 struct RGBA; 00027 00031 struct HSLA 00032 { 00033 HSLA(double h=0.0, double s=0.0, double l=0.0, double a=0.0); 00034 00035 HSLA(const RGBA& rgb); 00036 00037 double hue, saturation, lightness, alpha; 00038 00039 double operator[](unsigned index); 00040 00041 HSLA& operator=(const RGBA& rgb); 00042 00043 operator RGBA(); 00044 00045 }; 00046 00051 void rgb_to_hsl(double rgb_r, double rgb_g, double rgb_b, 00052 double& h, double& s, double& l); 00053 00058 void hsl_to_rgb(double hsl_h, double hsl_s, double hsl_l, 00059 double& rgb_r, double& rgb_g, double& rgb_b); 00060 00061 } 00062 00063 #endif
1.6.1