# \[BlocklyFeatureRequest\]Add ParseInt

**URL:** <https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667>\
**Category:** Meta\
**Created:** [29 August 2018 16:56 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667 "2018-08-29T16:56:57Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 August 2018 16:56 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/1 "2018-08-29T16:56:57Z")

</div>

**Discussion moved to Meta as its more about the forum than the Blockly issue**

1. Wan't sure where to make this post - is this OK for everyone?

2. When dealing with colours in RGB hex format #FF00FF for magenta etc, I find myself needing to translate them into seperate R, G and B values.

In current JS function mode I do stuff like this

```
var r = msg.payload.substring(1,3);
r = parseInt(r, 16).toString();
....

```

but currently if I want to do the same in Blockly I have to write own function to replace parseInt (which I've done successfully)

So I'm wondering if

Does core Blockly already have such a function written?

If it doesn't - can one be written (obviosuly yes)

But either way, should some requests like this be added into the Blockly node or should it stick to basic functions and methods.?

e.g just because we can do it - should we do it?

Simon

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 August 2018 17:07 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/2 "2018-08-29T17:07:33Z")

</div>

Shouldn't feature requests for a contrib node be made on the nodes github page?

There are currently 1602 contrib nodes on [flows.nodered.org](http://flows.nodered.org) if each node used #share-your-nodes for feature requests they could mask the new nodes that I thought this channel was here to promote?

---

<div class="post-metadata">

**Author:** ![dceejay](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/dceejay/32/38_2.png) [@dceejay](https://discourse.nodered.org/u/dceejay)\
**Post date:** [29 August 2018 17:42 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/3 "2018-08-29T17:42:35Z")

</div>

> [@cymplecy](#):
>
> e.g just because we can do it - should we do it?

A question we always ask ourselves at the core of Node-RED...

every feature added is one that needs to be maintained, and/or may "block" you into a corner preventing some other future course of action. (pun intended), and/or may make what was a simple node into something altogether more intimidating for a beginner.

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 August 2018 17:46 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/4 "2018-08-29T17:46:11Z")

</div>

> [@ukmoose](#):
>
> if each node used #Share Your Nodes for feature requests they could mask the new nodes that I thought this channel was here to promote?

Very good point 🙂  
I've created an FR issue on the nodes Github pages instead

> <https://github.com/bartbutenaers/node-red-contrib-blockly/issues/21>
>
> When dealing with colours in RGB hex format #FF00FF for magenta etc, I find myse…lf needing to translate them into seperate R, G and B values.
> 
> In current JS function mode I do stuff like this
> 
> \`\`\`
> var r = msg.payload.substring(1,3);
> r = parseInt(r, 16).toString();
> ....
> \`\`\`
> but currently if I want to do the same in Blockly I have to write my own function to replace parseInt (which I've done successfully)
> 
> So I'm wondering if
> 
> Does core Blockly already have such a function written?
> 
> If it doesn't - can one be written (obviously yes)
> 
> But either way, should some requests like this be added into the Blockly node or should it stick to basic functions and methods.?
> 
> e.g just because we can do it - should we do it?
> 
> Simon

Simon

---

<div class="post-metadata">

**Author:** ![shrickus](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/shrickus/32/517_2.png) [@shrickus](https://discourse.nodered.org/u/shrickus)\
**Post date:** [29 August 2018 19:01 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/5 "2018-08-29T19:01:38Z")

</div>

> [@cymplecy](#):
>
> When dealing with colours in RGB hex format #FF00FF for magenta etc, I find myself needing to translate them into seperate R, G and B values.

FWIW, here's a nice little function that I've used to get the r,g,b values from a hex color string:

```auto
let [r, g, b] = msg.payload.match(/[A-F0-9]{2}/gi).map(h => +("0x"+h));
msg.payload = {
    red: r,
    green: g,
    blue: b
}
return msg;

```

---

<div class="post-metadata">

**Author:** ![BartButenaers](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/bartbutenaers/32/10476_2.png) [@BartButenaers](https://discourse.nodered.org/u/BartButenaers)\
**Post date:** [29 August 2018 20:36 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/6 "2018-08-29T20:36:13Z")

</div>

> [@ukmoose](#):
>
> if each node used #Share Your Nodes for feature requests they could mask the new nodes that I thought this channel was here to promote

Yep, you are completely right !!!

But - in contrast to all my other contributions - I created the blockly node for attracting non-technical users to Node-RED. Since I'm a quite technical guy, I'm afraid that this contribution will evolve to a very technical node (when nobody restrains me 🥴 ). So I would like to discuss here with some people whether to implement a new request or not (or to solve it another way). When I would have to do that on Github, there will be no feedback from others. Until now the feedback was VERY valuable for me to create something usable ...

Would it be better if I put on my **readme file** on Github something like this for '_new feature request_':

1. Create an issue on Github
2. I myself will collect all requests of a new release and create a single discussion on this forum (to discuss all the new features at once)

Then I hopefully can get some feedback, and you guys don't end up with some kind of new Blockly forum.  
Is that ok ??

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 August 2018 21:07 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/7 "2018-08-29T21:07:05Z")

</div>

Maybe there's a few options that could be adopted

1. A Feature Request sub-category(like the one the main Development one has) in #share-your-nodes

2. Create a Contrib Node category for general contrib node discussion and leave #share-your-nodes for announcements as @ukmoose has suggested its for

or ???

I do think this Blockly node is worth cutting a bit of slack for (but I am very biased as I am its biggest supporter) 🙂

Simon

---

<div class="post-metadata">

**Author:** ![ukmoose](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/ukmoose/32/13_2.png) [@ukmoose](https://discourse.nodered.org/u/ukmoose)\
**Post date:** [29 August 2018 22:23 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/8 "2018-08-29T22:23:12Z")

</div>

As the author of a contrib node I would personally prefer that any feature requests are managed/requested in one location.

From a user perspective what happens if I add a feature request in the channel but the contrib node author doesn’t monitor the channel? Does it still get discussed?

---

<div class="post-metadata">

**Author:** ![cymplecy](https://sea2.discourse-cdn.com/flex026/user_avatar/discourse.nodered.org/cymplecy/32/2773_2.png) [@cymplecy](https://discourse.nodered.org/u/cymplecy)\
**Post date:** [29 August 2018 23:14 UTC](https://discourse.nodered.org/t/blocklyfeaturerequest-add-parseint/2667/9 "2018-08-29T23:14:17Z")

</div>

> [@ukmoose](#):
>
> As the author of a contrib node I would personally prefer that any feature requests are managed/requested in one location.....

Of course its up to an individual contrib author where they monitor and want such a discussion to take place.

I think if someone asks for an FR here and author is active here and is happy to keep discussion on here and the Node-RED team are OK with that, then I think its should be OK and just needs putting in an appropriate category or sub-category.

If someone asks for an FR here and author is thought not to be active, I think people just normally direct them off to the authors Github repository.

If an contrib author sees an FR on here and wants it discussed somewhere else, they could just reply and direct it to where they want

Simon
