Skip to content

Commit

Permalink
inline functions
Browse files Browse the repository at this point in the history
  • Loading branch information
Will Blanton authored and Will Blanton committed Feb 12, 2020
1 parent 273492c commit b01d923
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion zero/utilities/Color.hx
Original file line number Diff line number Diff line change
Expand Up @@ -162,7 +162,7 @@ abstract Color(Vec4)
public inline function to_hex_24():Int return ((red * 255).round() & 0xFF) << 16 | ((green * 255).round() & 0xFF) << 8 | ((blue * 255).round() & 0xFF);
public inline function from_int32(color:Int) return set(((color >> 16) & 0xff) / 255, ((color >> 8) & 0xff) / 255, (color & 0xff) / 255, ((color >> 24) & 0xff) / 255);
public inline function equals(color:Color) return red == color.red && green == color.green && blue == color.blue && alpha == color.alpha;
public function toString():String return 'r: $red | g: $green | b: $blue | a: $alpha | #${to_hex().hex()}';
public inline function toString():String return 'r: $red | g: $green | b: $blue | a: $alpha | #${to_hex().hex()}';

public function set_HSL(h:Float, s:Float, l:Float):Color
{
Expand Down
2 changes: 1 addition & 1 deletion zero/utilities/Rect.hx
Original file line number Diff line number Diff line change
Expand Up @@ -76,7 +76,7 @@ abstract Rect(Vec4)
return cast this;
}

public function toString():String return 'x: ${this.x} | y: ${this.y} | width: $width | height: $height';
public inline function toString():String return 'x: ${this.x} | y: ${this.y} | width: $width | height: $height';

public inline function area():Float return width * height;
public inline function contains_point(vec2:Vec2) return top <= vec2.y && bottom >= vec2.y && left <= vec2.x && right >= vec2.x;
Expand Down

0 comments on commit b01d923

Please sign in to comment.