- Click-freeze: If you click any of lines drawn, desmos will freeze. Sometimes you can recover your drawing but most of the time it is cleared.
Last active
October 25, 2024 23:58
-
-
Save thatrandomperson5/275c0e87620fa3971d9877746c343aff to your computer and use it in GitHub Desktop.
Developers docs for Desmosoft Paint
Desmos Paint versions:
w
: number, alias for Desmos constantwidth
h
: number, alias for Desmos constantheight
P_en
: bool, whether the pen is down or not (down is true)W_o
: color, White color. (Was the white-out color for the white out system) (Deprecated)H
: number, actual numerical height (relative to the graph). Normal height is in pixels and is relative to the screen.H_p
: number, height percentile. UI elements that adjust with the screen will use this.
L(a: cord, b: cord)
: function, draws a line between a and b (using slope-intercept and X limits)L_y(a: cord, b: cord)
: function, draws a vertical line between a and b if they are vertical. used asx = L_y(a, b)
D(P: list[cord])
: function, draws a line between all points in P.D_y(P: list[cord])
: function, draws a line between all the straight up point pairs in P.
C_1
: cord, current mouse coordinateC_2
: cord, previous mouse coordinate- Note: Large 0 opacity drag-able image serves as the mouse cursor
D_c
:number[time]
, double-click timerD_cf()
:function[action]
, general click function. Adds time to the double click timer, adds a break in the art, flips the pen variable. (CallsB_r()
)D_cc
:function[action]
, double click click. The click function. If double click, call clearC_l()
. Otherwise, callD_cf()
U()
:function[action]
, update line data. Adds the current mouse coordinates to the art list. Also adds current color and full opacity to their respective lists.R()
:functions[action]
, callU()
if notC_2 = C_1
M()
:function[action]
, main function called on each clock cycle. If pen is down callR()
. Otherwise, update previous coordinates to current coordinates. (Legacy)M_t()
:function[action]
, main function with account for FPS, delay, and time. Was implemented once I stopped relating on the builtin ticker timing. CallsM()
A
:list[cord]
, the “art” list. Contains coordinates who make the line that is your drawing.A_w
:list[number]
, contains opacity numbers for each segment specified inA
. Deprecated Version:list[cord]
, contains the whiteout line.C_l()
:function[action]
, clears the canvas. Resets all canvas-state variables. Does not reset the color pallet and cursor position likeR_eset()
does.B_r()
:function[action]
, creates a break in the current line structure by inserting opacity.
- Note: Background rounded rectangle, uses equation
max(0,|x-x1|-scaled_width)^2 + max(0, |y-y1|-scaled-height)^2 = (corner_radius)^2
G_diff
: number, space between color circlesG_iw
: number, width of a color circle and it’s marginG_df(i: number)
: function, calculates the position of a the i’th circle.G_r
: number, radius of the color circles.G_cn
: number, color circle count. Adjusted by 4 to leave space for custom color area.
C_c
: number, current color index of color listC
C_s
:list[number]
, color selected. Can be applied to the border opacity value of the circles and produces a “selected” effect.C_b
:list[color]
, base colors, applied to the pallet on reset.C_A
:list[color]
, colors for theA
line list. This enables changing of colors.C
:list[color]
, the current color pallet. Length is 15
D_t
:number[time]
, the difference time between ticks in milliseconds.F_ps
: number, the current FPS of the program. Displayed in the bottom left.
C_setCurrent()
:function[action]
, updates the color pallet at the current selection to the custom colorC_C
C_C
: color, the current custom color.C_Lf
: number, length/width of the color selection bars.C_Xi
: number, the X initial for the color selection bars.C_D(h_1: number)
: function, draws a dot bar at dynamic height h_1 (relative toH_p
)C_I
:list[color]
, an index array for dot bars.C_H, C_S, C_V
: number, parts of the custom HSV color value. All are adjustable with sliders.C_Hc, C_Sc
: color, the partial HSV values at each stage for preview.C_Hac, C_Sac, C_Vac
: respective and dynamic color/gradient list.
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment