color.c
Go to the documentation of this file.00001 #include "color.h"
00002
00003
00014 void NewColor(double r,double g,double b,Tcolor *c)
00015 {
00016 c->r=r;
00017 c->g=g;
00018 c->b=b;
00019 }
00020
00021 void CopyColor(Tcolor *c_dst,Tcolor *c_src)
00022 {
00023 c_dst->r=c_src->r;
00024 c_dst->g=c_src->g;
00025 c_dst->b=c_src->b;
00026 }
00027
00028 void SetRed(double r,Tcolor *c)
00029 {
00030 c->r=r;
00031 }
00032
00033 void SetGreen(double g,Tcolor *c)
00034 {
00035 c->g=g;
00036 }
00037
00038 void SetBlue(double b,Tcolor *c)
00039 {
00040 c->b=b;
00041 }
00042
00043 double GetRed(Tcolor *c)
00044 {
00045 return(c->r);
00046 }
00047
00048 double GetGreen(Tcolor *c)
00049 {
00050 return(c->r);
00051 }
00052
00053 double GetBlue(Tcolor *c)
00054 {
00055 return(c->r);
00056 }
00057
00058 void PrintColor(FILE *f,Tcolor *c)
00059 {
00060 fprintf(f,"%f %f %f",c->r,c->g,c->b);
00061 }
00062
00063 void DeleteColor(Tcolor *c)
00064 {
00065 }