Trying to build a contrast & saturation filter
This commit is contained in:
@@ -19,6 +19,12 @@ function Color(hex = '#000000')
|
||||
{
|
||||
return "rgba("+this.rgb().r+","+this.rgb().g+","+this.rgb().b+",1)";
|
||||
}
|
||||
|
||||
this.floats = function()
|
||||
{
|
||||
var rgb = this.rgb();
|
||||
return { r:rgb.r/255, g:rgb.g/255, b:rgb.b/255 }
|
||||
}
|
||||
|
||||
this.render = function()
|
||||
{
|
||||
|
||||
@@ -44,4 +44,13 @@ function Position(position_str = "0,0",y = null)
|
||||
{
|
||||
return (isNaN(this.x) ? 0 : this.x)+","+(isNaN(this.y) ? 0 : this.y);
|
||||
}
|
||||
|
||||
this.is_outside = function()
|
||||
{
|
||||
if(this.x < 0){ return true; }
|
||||
if(this.y < 0){ return true; }
|
||||
if(this.x > ronin.frame.element.width/2){ return true; }
|
||||
if(this.y > ronin.frame.element.height/2){ return true; }
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user