I would love an API (if I’m using that term in the right way) for counting individual colors used on a board. Does anyone have the ability/desire to create that?
When they are done, they have to count up the different colors and give me a total each color. If I could get rid of the counting step, it would help with speed and accuracy (and get rid of how annoying the counting is.)
I would love a solution in Miro for that!
That is a very easy API to create with javascript for example. The question is if you want to store these values on some sort of a server, locally on miro whiteboard or if you want to store in JSON files, or just in runtime data which gets wiped after session closes
If one of you (or anyone) took this on, I could see other uses for it that may benefit people outside of my very specific use case.
Anybody up for tackling this?
Wanted to keep this idea in the loop in the community. Would love it if someone could pull this off...
All you need to do this is a bit of javascript like so:
gatherColors()
function gatherColors() {
miro.onReady(() => {
miro.board.widgets.get().then(function(theWidgets) {
getColors(theWidgets)
})
})
}
function getColors(arrayOfWidgets) {
for (i = 0; i < arrayOfWidgets.length; i++) {
let colorsOfWidgets.push(arrayOfWidgets[i].style.backgroundColor)
}
}
At this point all board widget colors are gathered all you need after this is some sort of sorting and a output you prefer weather that is a JSON file which can be compatible with a google doc or just a board notification, etc…
You can either find some more efficient sorting algorithm online or use something basic like this:
function sortColors(colorsOfWidgets) {
for(i = 0; i < colorsOfWidgets.length; i++) {
if (colorOfWidgets[i] == “#12cdd4”) { //color code for cyan color
let cyanColor = cyanColor + 1 // same approach for all other colors miro widgets support
}
}
}
Hope this helps.
Sami
Keeping this idea in the air...Wondering if anyone else would benefit from it.
Did anyone manage to implement this for you?
If not … I’d be happy to quickly tackle it. Its super simple.
Should the app count all items on the board and get all colors? or Should it only count colors on a subset of what’s on the board? examples:
- count colors only on the items selected by the user
- count colors only of sticky notes. or shapes. or squares. or rounded corner squares.
- etc.
Would you want this to work more like A, B or C ? :
A) Count tallies in the plugin.

B) Count tallies onto the board.

C) Both Options: Count tallies in the Plugin and/or the Board.

I think option A would be fantastic. That’s exactly what I was looking for! I would be using it with the highlighter function in the Miro drawing tool. Do you think that would work out?
Thanks again for making something happen on this! It will be a huge time saver for me and my team.
My team would be tallying up colors in a specific frame. I don’t know if its possible for you to limit the selection to a frame…
If they had to drag a selection around what they wanted counted, I don’t think that would be too much of a problem, though.
Thanks!
Reply
Enter your username or e-mail address. We'll send you an e-mail with instructions to reset your password.