Skip to content

Commit f76b3db

Browse files
mark color fmt conv functions as nothrow and pure
1 parent f085bbd commit f76b3db

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

inmath/color.d

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,7 @@ unittest {
204204
/**
205205
Returns RGBA color from 0..1 from colors in range 0..255
206206
*/
207-
vec4 rgbau2rgba(ubyte[4] colors) {
207+
@safe pure nothrow vec4 rgbau2rgba(ubyte[4] colors) {
208208
return vec4(
209209
cast(float)colors[0]/255.0,
210210
cast(float)colors[1]/255.0,
@@ -216,7 +216,7 @@ vec4 rgbau2rgba(ubyte[4] colors) {
216216
/**
217217
Returns RGB color from 0..1 from colors in range 0..255
218218
*/
219-
vec3 rgbu2rgb(ubyte[3] colors) {
219+
@safe pure nothrow vec3 rgbu2rgb(ubyte[3] colors) {
220220
return vec3(
221221
cast(float)colors[0]/255.0,
222222
cast(float)colors[1]/255.0,
@@ -227,7 +227,7 @@ vec3 rgbu2rgb(ubyte[3] colors) {
227227
/**
228228
Returns RGBA color from 0..255 from colors in range 0..1
229229
*/
230-
ubyte[4] rgba2rgbau(vec4 colors) {
230+
@safe pure nothrow ubyte[4] rgba2rgbau(vec4 colors) {
231231
ubyte[4] color;
232232
static foreach(i; 0..4) {
233233
color[i] = cast(ubyte)(colors.vector[i]*255.0);
@@ -238,7 +238,7 @@ ubyte[4] rgba2rgbau(vec4 colors) {
238238
/**
239239
Returns RGB color from 0..255 from colors in range 0..1
240240
*/
241-
ubyte[3] rgb2rgbu(vec3 colors) {
241+
@safe pure nothrow ubyte[3] rgb2rgbu(vec3 colors) {
242242
ubyte[3] color;
243243
static foreach(i; 0..3) {
244244
color[i] = cast(ubyte)(colors.vector[i]*255.0);

0 commit comments

Comments
 (0)