Skip to content

Instantly share code, notes, and snippets.

@cegiela
Forked from melMass/Paint Code Expressions.md
Last active June 1, 2021 22:24
Show Gist options
  • Select an option

  • Save cegiela/6af7854db2b728725abe5c29f18fadea to your computer and use it in GitHub Desktop.

Select an option

Save cegiela/6af7854db2b728725abe5c29f18fadea to your computer and use it in GitHub Desktop.

Revisions

  1. cegiela revised this gist Jun 1, 2021. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -42,6 +42,9 @@ Functions
    ### frac(x)
    *returns the fractional part of x*

    ### pow(x, y)
    *returns x to the eponent y*

    ### sqrt(x)
    *returns the square root of x*

  2. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 5 additions and 4 deletions.
    9 changes: 5 additions & 4 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -26,7 +26,8 @@ Operators

    Functions
    ---------
    # Math

    ## Math


    ### floor(x)
    @@ -54,7 +55,7 @@ Functions
    *returns the larger of the two parameters*


    # Goniometric Functions
    ## Goniometric Functions

    ### sin(a), cos(a), tan(a)
    goniometric functions.
    @@ -63,7 +64,7 @@ Note: parameter a should be in degrees
    ### atan2(y, x)
    arc tangent in degrees of y/x based on the signs of both values to determine the correct quadrant

    # Colors, gradients and shadows
    ## Colors, gradients and shadows

    ### makeColor(r, g, b, a)
    returns color with components r, g, b, a (red, green, blue, alpha). All parameters should be from interval 0..1
    @@ -74,7 +75,7 @@ returns two step gradient with colors c1 and c2
    ### makeShadow(color, xOffset, yOffset, blurRadius)
    returns shadow

    # Other Functions
    ## Other Functions

    ### makePoint(x, y)
    returns point
  3. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 2 additions and 1 deletion.
    3 changes: 2 additions & 1 deletion Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,8 +1,9 @@

    <h1 align="center">PaintCode Expressions</h1>
    <p align="center">
    <img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" />
    </p>

    Operators
    ---------

    **!b** *boolean* logical negation of b
  4. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 2 additions and 3 deletions.
    5 changes: 2 additions & 3 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,9 +1,8 @@
    ![Paintcode](https://www.paintcodeapp.com/images/paintcode_icon.png)

    <p align="center">
    <img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" />
    </p>
    <div style="text-align:center"><img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" /></div>
    Operators

    ---------

    **!b** *boolean* logical negation of b
  5. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 3 additions and 0 deletions.
    3 changes: 3 additions & 0 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,7 @@
    ![Paintcode](https://www.paintcodeapp.com/images/paintcode_icon.png)
    <p align="center">
    <img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" />
    </p>
    <div style="text-align:center"><img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" /></div>
    Operators
    ---------
  6. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 1 addition and 0 deletions.
    1 change: 1 addition & 0 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,5 @@
    ![Paintcode](https://www.paintcodeapp.com/images/paintcode_icon.png)
    <div style="text-align:center"><img src ="https://www.paintcodeapp.com/images/paintcode_icon.png" /></div>
    Operators
    ---------

  7. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,4 +1,4 @@

    ![Paintcode](https://www.paintcodeapp.com/images/paintcode_icon.png)
    Operators
    ---------

  8. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 85 additions and 36 deletions.
    121 changes: 85 additions & 36 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,36 +1,85 @@
    ### Variables Types

    - makeRect(0, 0, 640, 1136)
    - makeSize(10, 20)
    - makeColor(1, 1, 0, 1)
    - makeGradient(makeColor(1, 0, 0, 1),
    makeColor(1, 0, 0, 0))

    ### Middle Point
    - makePoint((positionA.x + positionB.x) / 2,
    (positionA.y + positionB.y) / 2)


    ### operator type result
    !b boolean logical negation of b
    x * y numbers product of numbers x and y
    x / y numbers quotient of numbers x and y
    x % y numbers remainder after performing division of x and y; modulus
    m + n texts concatenation of the texts m and n
    x + y numbers sum of numbers x and y
    x - y numbers difference of x and y
    x > y numbers true if x is greater than y, false otherwise
    x >= y numbers true if x is greater than or equal to y, false otherwise
    x < y numbers true if x is less than y, false otherwise
    x <= y numbers true if x is less than or equal to y, false otherwise
    a == b same type true if a is equal to b, false otherwise
    a != b same type true if a is not equal to b, false otherwise
    a && b booleans true if a and b both true, false otherwise
    a || b booleans false if a and b both false, true otherwise
    b ? x : y b - boolean
    x, y - same if b is true, result is x, otherwise result is y

    ### Basic math functions

    #### floor(x)
    returns x rounded downwards

    Operators
    ---------

    **!b** *boolean* logical negation of b
    **x * y** *numbers* product of numbers x and y
    **x / y** *numbers* quotient of numbers x and y
    **x % y** *numbers* remainder after performing division of x and y (modulus)
    **m + n** *texts* concatenation of the texts m and n
    **x + y** *numbers* sum of numbers x and y
    **x - y** *numbers* difference of x and y
    **x > y** *numbers* true if x is greater than y, false otherwise
    **x >= y** *numbers* true if x is greater than or equal to y, false otherwise
    **x < y** *numbers* true if x is less than y, false otherwise
    **x <= y** *numbers* true if x is less than or equal to y, false otherwise
    **a == b** *same type* true if a is equal to b, false otherwise
    **a != b** *same type* true if a is not equal to b, false otherwise
    **a && b** *booleans* true if a and b both true, false otherwise
    **a || b** *booleans* false if a and b both false, true otherwise
    **b ? x : y b** - *boolean* if b is true, result is x, otherwise result is y


    Functions
    ---------
    # Math


    ### floor(x)
    *returns x rounded downwards*

    ### ceil(x)
    *returns x rounded upwards*

    ### round(x)
    *returns x rounded to nearest integer*

    ### frac(x)
    *returns the fractional part of x*

    ### sqrt(x)
    *returns the square root of x*

    ### abs(x)
    *returns the absolute value of x*

    ### min(x, y)
    *returns the smaller of the two parameters*

    ### max(x, y)
    *returns the larger of the two parameters*


    # Goniometric Functions

    ### sin(a), cos(a), tan(a)
    goniometric functions.
    Note: parameter a should be in degrees

    ### atan2(y, x)
    arc tangent in degrees of y/x based on the signs of both values to determine the correct quadrant

    # Colors, gradients and shadows

    ### makeColor(r, g, b, a)
    returns color with components r, g, b, a (red, green, blue, alpha). All parameters should be from interval 0..1

    ### makeGradient(c1, c2)
    returns two step gradient with colors c1 and c2

    ### makeShadow(color, xOffset, yOffset, blurRadius)
    returns shadow

    # Other Functions

    ### makePoint(x, y)
    returns point

    ### makeSize(width, height)
    returns size

    ### makeRect(x, y, width, height)
    returns rect with position of origin (x, y) and size (width, height)

    ### stringFromNumber(x)
    converts number x to text
  9. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 1 addition and 1 deletion.
    2 changes: 1 addition & 1 deletion Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -33,4 +33,4 @@ x, y - same if b is true, result is x, otherwise result is y
    ### Basic math functions

    #### floor(x)
    returns x rounded downwards
    returns x rounded downwards
  10. @melMass melMass revised this gist Oct 30, 2016. 1 changed file with 10 additions and 6 deletions.
    16 changes: 10 additions & 6 deletions Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,13 +1,13 @@
    ### Variables Types

    makeRect(0, 0, 640, 1136)
    makeSize(10, 20)
    makeColor(1, 1, 0, 1)
    makeGradient(makeColor(1, 0, 0, 1),
    - makeRect(0, 0, 640, 1136)
    - makeSize(10, 20)
    - makeColor(1, 1, 0, 1)
    - makeGradient(makeColor(1, 0, 0, 1),
    makeColor(1, 0, 0, 0))

    ### Middle Point
    makePoint((positionA.x + positionB.x) / 2,
    - makePoint((positionA.x + positionB.x) / 2,
    (positionA.y + positionB.y) / 2)


    @@ -29,4 +29,8 @@ a && b booleans true if a and b both true, false otherwise
    a || b booleans false if a and b both false, true otherwise
    b ? x : y b - boolean
    x, y - same if b is true, result is x, otherwise result is y


    ### Basic math functions

    #### floor(x)
    returns x rounded downwards
  11. @melMass melMass renamed this gist Oct 30, 2016. 1 changed file with 4 additions and 5 deletions.
    9 changes: 4 additions & 5 deletions Paint Code Expressions → Paint Code Expressions.md
    Original file line number Diff line number Diff line change
    @@ -1,18 +1,17 @@
    makeRect(0, 0, 640, 1136)

    ### Variables Types

    makeRect(0, 0, 640, 1136)
    makeSize(10, 20)
    makeColor(1, 1, 0, 1)

    makeGradient(makeColor(1, 0, 0, 1),
    makeColor(1, 0, 0, 0))

    // Middle Point
    ### Middle Point
    makePoint((positionA.x + positionB.x) / 2,
    (positionA.y + positionB.y) / 2)


    operator type result
    ### operator type result
    !b boolean logical negation of b
    x * y numbers product of numbers x and y
    x / y numbers quotient of numbers x and y
  12. @melMass melMass created this gist Oct 30, 2016.
    33 changes: 33 additions & 0 deletions Paint Code Expressions
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,33 @@
    makeRect(0, 0, 640, 1136)


    makeSize(10, 20)
    makeColor(1, 1, 0, 1)

    makeGradient(makeColor(1, 0, 0, 1),
    makeColor(1, 0, 0, 0))

    // Middle Point
    makePoint((positionA.x + positionB.x) / 2,
    (positionA.y + positionB.y) / 2)


    operator type result
    !b boolean logical negation of b
    x * y numbers product of numbers x and y
    x / y numbers quotient of numbers x and y
    x % y numbers remainder after performing division of x and y; modulus
    m + n texts concatenation of the texts m and n
    x + y numbers sum of numbers x and y
    x - y numbers difference of x and y
    x > y numbers true if x is greater than y, false otherwise
    x >= y numbers true if x is greater than or equal to y, false otherwise
    x < y numbers true if x is less than y, false otherwise
    x <= y numbers true if x is less than or equal to y, false otherwise
    a == b same type true if a is equal to b, false otherwise
    a != b same type true if a is not equal to b, false otherwise
    a && b booleans true if a and b both true, false otherwise
    a || b booleans false if a and b both false, true otherwise
    b ? x : y b - boolean
    x, y - same if b is true, result is x, otherwise result is y