@@ -67,9 +67,9 @@ Color Color::rgb() const
6767 float r = 0 ., g = 0 ., b = 0 .;
6868
6969 // Normalisation des valeurs
70- float h = (*this )[0 ] / 360 .; // Hue normalisée (0 à 1)
71- float s = (*this )[1 ] / 100 .; // Saturation normalisée (0 à 1)
72- float v = (*this )[2 ] / 100 .; // Value normalisée (0 à 1)
70+ float h = (*this )[0 ] / 360 .f ; // Hue normalisée (0 à 1)
71+ float s = (*this )[1 ] / 100 .f ; // Saturation normalisée (0 à 1)
72+ float v = (*this )[2 ] / 100 .f ; // Value normalisée (0 à 1)
7373
7474 int i = static_cast <int >(h * 6 );
7575 float f = (h * 6 ) - i;
@@ -93,7 +93,7 @@ Color Color::rgb() const
9393 g *= 255 .;
9494 b *= 255 .;
9595
96- return Color ({r, g, b,std::min<float >(255 .,((*this )[3 ]*2.55 ))},Model::RGB );
96+ return Color ({r, g, b,std::min<float >(255 .f ,((*this )[3 ]*2 .55f ))},Model::RGB );
9797 }
9898}
9999
@@ -103,21 +103,21 @@ Color Color::hsv() const
103103 return *this ;
104104 else
105105 {
106- float r = (*this )[0 ]/255 .;
107- float g = (*this )[1 ]/255 .;
108- float b = (*this )[2 ]/255 .;
106+ float r = (*this )[0 ]/255 .f ;
107+ float g = (*this )[1 ]/255 .f ;
108+ float b = (*this )[2 ]/255 .f ;
109109 float c_max = std::max ({r, g, b});
110110 float c_min = std::min ({r, g, b});
111111 float delta = c_max - c_min;
112112
113113 float h = 0.0 ;
114114 if (delta != 0 ) {
115115 if (c_max == r) {
116- h = fmod ((g - b) / delta, 6.0 );
116+ h = std:: fmod ((g - b) / delta, 6 .0f );
117117 } else if (c_max == g) {
118- h = (b - r) / delta + 2.0 ;
118+ h = (b - r) / delta + 2 .0f ;
119119 } else if (c_max == b) {
120- h = (r - g) / delta + 4.0 ;
120+ h = (r - g) / delta + 4 .0f ;
121121 }
122122 h /= 6.0 ;
123123 if (h < 0 ) {
@@ -133,7 +133,7 @@ Color Color::hsv() const
133133 s*=100 .;
134134 v*=100 .;
135135
136- return Color ({h, s, v,std::min<float >(100 .,((*this )[3 ]/2.55 ))},Model::HSV );
136+ return Color ({h, s, v,std::min<float >(100 .f ,((*this )[3 ]/2 .55f ))},Model::HSV );
137137 }
138138}
139139
0 commit comments