Code Monkey home page Code Monkey logo

Comments (2)

dgant avatar dgant commented on June 18, 2024

Exact values

(0 until 256 by 32).flatMap(r =>
  (0 until 256 by 32).flatMap(g =>
    (0 until 256 by 32).map(b =>
      Seq((r, g, b), "=", new Color(r, g, b).id).mkString(" "))))

 0 = "(0,0,0) = 0"
 1 = "(0,0,32) = 40"
 2 = "(0,0,64) = -121"
 3 = "(0,0,96) = 42"
 4 = "(0,0,128) = -120"
 5 = "(0,0,160) = -120"
 6 = "(0,0,192) = -120"
 7 = "(0,0,224) = -120"
 8 = "(0,32,0) = -74"
 9 = "(0,32,32) = -78"
 10 = "(0,32,64) = 41"
 11 = "(0,32,96) = -96"
 12 = "(0,32,128) = -96"
 13 = "(0,32,160) = 45"
 14 = "(0,32,192) = 45"
 15 = "(0,32,224) = 45"
 16 = "(0,64,0) = -73"
 17 = "(0,64,32) = -79"
 18 = "(0,64,64) = -99"
 19 = "(0,64,96) = -96"
 20 = "(0,64,128) = 45"
 21 = "(0,64,160) = 45"
 22 = "(0,64,192) = 45"
 23 = "(0,64,224) = 45"
 24 = "(0,96,0) = -72"
 25 = "(0,96,32) = -79"
 26 = "(0,96,64) = -99"
 27 = "(0,96,96) = 113"
 28 = "(0,96,128) = 113"
 29 = "(0,96,160) = 45"
 30 = "(0,96,192) = 45"
 31 = "(0,96,224) = 45"
 32 = "(0,128,0) = -72"
 33 = "(0,128,32) = -77"
 34 = "(0,128,64) = 113"
 35 = "(0,128,96) = 113"
 36 = "(0,128,128) = 113"
 37 = "(0,128,160) = 113"
 38 = "(0,128,192) = 45"
 39 = "(0,128,224) = 45"
 40 = "(0,160,0) = -77"
 41 = "(0,160,32) = -77"
 42 = "(0,160,64) = -77"
 43 = "(0,160,96) = 113"
 44 = "(0,160,128) = 113"
 45 = "(0,160,160) = 113"
 46 = "(0,160,192) = 113"
 47 = "(0,160,224) = 47"
 48 = "(0,192,0) = -77"
 49 = "(0,192,32) = -77"
 50 = "(0,192,64) = -77"
 51 = "(0,192,96) = 113"
 52 = "(0,192,128) = 113"
 53 = "(0,192,160) = 113"
 54 = "(0,192,192) = 113"
 55 = "(0,192,224) = 47"
 56 = "(0,224,0) = -77"
 57 = "(0,224,32) = -77"
 58 = "(0,224,64) = -77"
 59 = "(0,224,96) = 112"
 60 = "(0,224,128) = 112"
 61 = "(0,224,160) = 112"
 62 = "(0,224,192) = 112"
 63 = "(0,224,224) = 112"
 64 = "(32,0,0) = -87"
 65 = "(32,0,32) = 117"
 66 = "(32,0,64) = 119"
 67 = "(32,0,96) = 42"
 68 = "(32,0,128) = -120"
 69 = "(32,0,160) = -120"
 70 = "(32,0,192) = -120"
 71 = "(32,0,224) = -120"
 72 = "(32,32,0) = 53"
 73 = "(32,32,32) = 66"
 74 = "(32,32,64) = 120"
 75 = "(32,32,96) = 121"
 76 = "(32,32,128) = 45"
 77 = "(32,32,160) = 45"
 78 = "(32,32,192) = 45"
 79 = "(32,32,224) = 45"
 80 = "(32,64,0) = 53"
 81 = "(32,64,32) = 34"
 82 = "(32,64,64) = 43"
 83 = "(32,64,96) = -63"
 84 = "(32,64,128) = 45"
 85 = "(32,64,160) = 45"
 86 = "(32,64,192) = 45"
 87 = "(32,64,224) = 45"
 88 = "(32,96,0) = -72"
 89 = "(32,96,32) = -99"
 90 = "(32,96,64) = -99"
 91 = "(32,96,96) = 46"
 92 = "(32,96,128) = 46"
 93 = "(32,96,160) = 47"
 94 = "(32,96,192) = 45"
 95 = "(32,96,224) = 45"
 96 = "(32,128,0) = -72"
 97 = "(32,128,32) = 35"
 98 = "(32,128,64) = 35"
 99 = "(32,128,96) = 113"

from jbwapi.

dgant avatar dgant commented on June 18, 2024

The issue is that Java bytes are signed compared to the original C++ code using BYTE which is (presumably -- I haven't checked) unsigned. Replacing all the bytes with ints seems to fix it:

image
image

Happy Vision is happy again:

image

I'll open a PR.

from jbwapi.

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.