removed CLAMP define

This commit is contained in:
spookerton
2022-03-31 19:21:58 +01:00
parent bcfe3e9851
commit 602cc67d2b
65 changed files with 116 additions and 118 deletions

View File

@@ -929,9 +929,9 @@ GLOBAL_LIST_EMPTY(cached_examine_icons)
if (!value) return color
var/list/RGB = ReadRGB(color)
RGB[1] = CLAMP(RGB[1]+value,0,255)
RGB[2] = CLAMP(RGB[2]+value,0,255)
RGB[3] = CLAMP(RGB[3]+value,0,255)
RGB[1] = clamp(RGB[1]+value,0,255)
RGB[2] = clamp(RGB[2]+value,0,255)
RGB[3] = clamp(RGB[3]+value,0,255)
return rgb(RGB[1],RGB[2],RGB[3])
/proc/sort_atoms_by_layer(var/list/atoms)

View File

@@ -50,7 +50,7 @@
/proc/color_rotation(angle)
if(angle == 0)
return color_identity()
angle = CLAMP(angle, -180, 180)
angle = clamp(angle, -180, 180)
var/cos = cos(angle)
var/sin = sin(angle)
@@ -65,7 +65,7 @@
//Makes everything brighter or darker without regard to existing color or brightness
/proc/color_brightness(power)
power = CLAMP(power, -255, 255)
power = clamp(power, -255, 255)
power = power/255
return list(1,0,0, 0,1,0, 0,0,1, power,power,power)
@@ -85,7 +85,7 @@
//Exxagerates or removes brightness
/proc/color_contrast(value)
value = CLAMP(value, -100, 100)
value = clamp(value, -100, 100)
if(value == 0)
return color_identity()
@@ -108,7 +108,7 @@
/proc/color_saturation(value as num)
if(value == 0)
return color_identity()
value = CLAMP(value, -100, 100)
value = clamp(value, -100, 100)
if(value > 0)
value *= 3
var/x = 1 + value / 100