Not logged in.  Login/Logout/Register | List snippets | | Create snippet | Upload image | Upload data

6
LINES

< > BotCompany Repo | #1022908 // color332toByte - see to332String

JavaX fragment (include)

static byte color332toByte(S s) {
  if (l(s) != 3) fail(s);
  ret (byte) ((parseInt(substring(s, 0, 1)) << 5)
    | (parseInt(substring(s, 1, 2)) << 2)
    | parseInt(substring(s, 2)));
}

download  show line numbers  debug dex  old transpilations   

Travelled to 7 computer(s): bhatertpkbcr, cfunsshuasjs, mqqgnosmbjvj, pyentgdyhuwx, pzhvpgtvlbxg, tvejysmllsmz, vouqrxazstgt

No comments. add comment

Snippet ID: #1022908
Snippet name: color332toByte - see to332String
Eternal ID of this version: #1022908/1
Text MD5: f6a63bd405f0c4848b09ec580ce2774b
Author: stefan
Category: javax / image analysis
Type: JavaX fragment (include)
Public (visible to everyone): Yes
Archived (hidden from active list): No
Created/modified: 2019-04-14 20:36:23
Source code size: 192 bytes / 6 lines
Pitched / IR pitched: No / No
Views / Downloads: 278 / 315
Referenced in: #1006654 - Standard functions list 2 (LIVE, continuation of #761)
#1022914 - color332toInt
#1024802 - color332toRGB