Merge pull request #86 from ngradwohl/feature/color-functions

add functions for rgba and hsla color values
This commit is contained in:
Лu Лinveгa 2019-07-28 16:07:47 +12:00 committed by GitHub
commit 5ad6ec3936
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -115,6 +115,18 @@ function Library (ronin) {
return rect
}
// colors
this.rgba = (r, g, b, a) => { // defines a color r, g, b values are from 0 to 255, a from 0 to 1
return "rgba("+r+","+g+","+b+","+a+")";
}
this.hsla = (h, s, l, a) => { // defines a color h from 0 to 360, s and l from 0 to 100, a from 0 to 1
return "hsla("+h+","+s+"%,"+l+"%,"+a+")";
}
// Frame
this.frame = () => { // Returns a rect of the frame.