GithubHelp home page GithubHelp logo

Dark Mode about qboard HOT 5 OPEN

Ii-xD-iI avatar Ii-xD-iI commented on June 11, 2024
Dark Mode

from qboard.

Comments (5)

cjquines avatar cjquines commented on June 11, 2024 2

im not sure how much moral agreement i have with having dark mode an officially sanctioned feature

from qboard.

pihart avatar pihart commented on June 11, 2024

There are two possible things you might want to do. Please let us know which you want so we can work on it.

(I will soon be releasing a toolkit of bookmarklets or a browser extension that implements a number of power user scripts. The following workarounds will be included.)

You want the view to be dark, but the exports to have the proper color scheme

Temporary solution: execute this script:

var aviThemeToggle=!aviThemeToggle;document.querySelectorAll(":root").forEach(el=>{el.style.background="white";el.style.filter=aviThemeToggle?"invert(1) hue-rotate(180deg)":""});document.querySelectorAll("body main").forEach(el=>{el.style.background="white";})

You want the entire board to become a blackboard

Temporary solution: #160 (comment) includes a snippet:

qboard.baseCanvas.setBackgroundColor("#111").renderAll()

that will convert the current page to a blackboard. It does not turn the black pen into a white pen, nor does it change the color in which LaTeX renders. To change the behavior of the black pen into drawing white, use another script from #160 (comment):

qboard.action.actionMap.black = () => qboard.action.setStroke("#fff")

and to change the LaTeX colors, just use the \color command in the TeX (#159 will allow you to do this only once, instead of every time you insert LaTeX).

Any new pages added will still be white; there is no way to change this behavior (see #206 for details) without editing internal functions, which is not recommended.

from qboard.

pihart avatar pihart commented on June 11, 2024

an officially sanctioned feature

Yes, if @Ii-xD-iI means the first option, I don't support this either. It feels wrong to support having the actual file content look different from what the file creator sees, especially when workaround like my script above work well. I opened #207, so that users get finer control over their own client's theme, but I think most will be fine with the existing script.

On the other hand, I am in full support of the second option. I see no reason not to allow customizing the page color (will be possible for developers with #206), and changing the pen colors has already been proposed in #170 and #169.

One thing to be mindful of is that if one switches to a blackboard, and still wants to make the toolbar/modals/context menu dark, they can't use the dark theme script I provided, since this would invert the colors that the user has already set (for the board and the pens). I do think that we should do something to support this: either the CSS variables trick (#207) or a dark mode that only touches the toolbar/modals/context menu and not the board; I think we should do both of these, actually. Then, we should be smart enough to use the browser's prefers-color-scheme to choose the default color scheme.

from qboard.

Ii-xD-iI avatar Ii-xD-iI commented on June 11, 2024

There are two possible things you might want to do. Please let us know which you want so we can work on it.

(I will soon be releasing a toolkit of bookmarklets or a browser extension that implements a number of power user scripts. The following workarounds will be included.)

You want the view to be dark, but the exports to have the proper color scheme

Temporary solution: execute this script:

var aviThemeToggle=!aviThemeToggle;document.querySelectorAll(":root").forEach(el=>{el.style.background="white";el.style.filter=aviThemeToggle?"invert(1) hue-rotate(180deg)":""});document.querySelectorAll("body main").forEach(el=>{el.style.background="white";})

You want the entire board to become a blackboard

Temporary solution: #160 (comment) includes a snippet:

qboard.baseCanvas.setBackgroundColor("#111").renderAll()

that will convert the current page to a blackboard. It does not turn the black pen into a white pen, nor does it change the color in which LaTeX renders. To change the behavior of the black pen into drawing white, use another script from #160 (comment):

qboard.action.actionMap.black = () => qboard.action.setStroke("#fff")

and to change the LaTeX colors, just use the \color command in the TeX (#159 will allow you to do this only once, instead of every time you insert LaTeX).

Any new pages added will still be white; there is no way to change this behavior (see #206 for details) without editing internal functions, which is not recommended.

in the continuation of this thread,
I feel like the 2nd option stated by @pihart seems more precise with what I've been looking for

from qboard.

pihart avatar pihart commented on June 11, 2024

Ok, I feel like this is a good idea, but it depends on a number of other changes which would need to be done earlier.

from qboard.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.