Skip to content

Instantly share code, notes, and snippets.

@remitbri
Last active August 29, 2015 14:17

Revisions

  1. remitbri revised this gist Mar 24, 2015. 1 changed file with 1 addition and 3 deletions.
    4 changes: 1 addition & 3 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -5,9 +5,7 @@ alpha = parseInt(hexa,16)/255

    ```js
    for (i=0; i<256; i++) {
    var deci = i/255
    var hex = i.toString(16)
    console.log(hex, deci)
    console.log(i.toString(16), i/255)
    }
    ```

  2. remitbri revised this gist Mar 24, 2015. 1 changed file with 1 addition and 2 deletions.
    3 changes: 1 addition & 2 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -27,8 +27,7 @@ for (i=0; i<256; i++) {
    - ee <=> 0.93333
    - ff <=> 1



    -----

    - 01 <=> 0.00392
    - 02 <=> 0.00784
  3. remitbri revised this gist Mar 24, 2015. 1 changed file with 18 additions and 0 deletions.
    18 changes: 18 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -11,6 +11,24 @@ for (i=0; i<256; i++) {
    }
    ```

    - 11 <=> 0.06667
    - 22 <=> 0.13333
    - 33 <=> 0.2
    - 44 <=> 0.26667
    - 55 <=> 0.33333
    - 66 <=> 0.4
    - 77 <=> 0.46667
    - 88 <=> 0.53333
    - 99 <=> 0.6
    - aa <=> 0.66667
    - bb <=> 0.73333
    - cc <=> 0.8
    - dd <=> 0.86667
    - ee <=> 0.93333
    - ff <=> 1




    - 01 <=> 0.00392
    - 02 <=> 0.00784
  4. remitbri revised this gist Mar 24, 2015. 1 changed file with 16 additions and 15 deletions.
    31 changes: 16 additions & 15 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -28,7 +28,7 @@ for (i=0; i<256; i++) {
    - 0e <=> 0.0549
    - 0f <=> 0.05882
    - 10 <=> 0.06275
    - **11** <=> 0.06667
    - **11 <=> 0.06667**
    - 12 <=> 0.07059
    - 13 <=> 0.07451
    - 14 <=> 0.07843
    @@ -45,7 +45,7 @@ for (i=0; i<256; i++) {
    - 1f <=> 0.12157
    - 20 <=> 0.12549
    - 21 <=> 0.12941
    - **22** <=> 0.13333
    - **22 <=> 0.13333**
    - 23 <=> 0.13725
    - 24 <=> 0.14118
    - 25 <=> 0.1451
    @@ -62,7 +62,7 @@ for (i=0; i<256; i++) {
    - 30 <=> 0.18824
    - 31 <=> 0.19216
    - 32 <=> 0.19608
    - **33** <=> 0.2
    - **33 <=> 0.2**
    - 34 <=> 0.20392
    - 35 <=> 0.20784
    - 36 <=> 0.21176
    @@ -79,7 +79,7 @@ for (i=0; i<256; i++) {
    - 41 <=> 0.2549
    - 42 <=> 0.25882
    - 43 <=> 0.26275
    - **44** <=> 0.26667
    - **44 <=> 0.26667**
    - 45 <=> 0.27059
    - 46 <=> 0.27451
    - 47 <=> 0.27843
    @@ -96,7 +96,7 @@ for (i=0; i<256; i++) {
    - 52 <=> 0.32157
    - 53 <=> 0.32549
    - 54 <=> 0.32941
    - **55** <=> 0.33333
    - **55 <=> 0.33333**
    - 56 <=> 0.33725
    - 57 <=> 0.34118
    - 58 <=> 0.3451
    @@ -113,7 +113,7 @@ for (i=0; i<256; i++) {
    - 63 <=> 0.38824
    - 64 <=> 0.39216
    - 65 <=> 0.39608
    - **66** <=> 0.4
    - **66 <=> 0.4**
    - 67 <=> 0.40392
    - 68 <=> 0.40784
    - 69 <=> 0.41176
    @@ -130,7 +130,7 @@ for (i=0; i<256; i++) {
    - 74 <=> 0.4549
    - 75 <=> 0.45882
    - 76 <=> 0.46275
    - **77** <=> 0.46667
    - **77 <=> 0.46667**
    - 78 <=> 0.47059
    - 79 <=> 0.47451
    - 7a <=> 0.47843
    @@ -147,7 +147,7 @@ for (i=0; i<256; i++) {
    - 85 <=> 0.52157
    - 86 <=> 0.52549
    - 87 <=> 0.52941
    - **88** <=> 0.53333
    - **88 <=> 0.53333**
    - 89 <=> 0.53725
    - 8a <=> 0.54118
    - 8b <=> 0.5451
    @@ -164,7 +164,7 @@ for (i=0; i<256; i++) {
    - 96 <=> 0.58824
    - 97 <=> 0.59216
    - 98 <=> 0.59608
    - **99** <=> 0.6
    - **99 <=> 0.6**
    - 9a <=> 0.60392
    - 9b <=> 0.60784
    - 9c <=> 0.61176
    @@ -181,7 +181,7 @@ for (i=0; i<256; i++) {
    - a7 <=> 0.6549
    - a8 <=> 0.65882
    - a9 <=> 0.66275
    - **aa** <=> 0.66667
    - **aa <=> 0.66667**
    - ab <=> 0.67059
    - ac <=> 0.67451
    - ad <=> 0.67843
    @@ -198,7 +198,7 @@ for (i=0; i<256; i++) {
    - b8 <=> 0.72157
    - b9 <=> 0.72549
    - ba <=> 0.72941
    - **bb** <=> 0.73333
    - **bb <=> 0.73333**
    - bc <=> 0.73725
    - bd <=> 0.74118
    - be <=> 0.7451
    @@ -215,7 +215,7 @@ for (i=0; i<256; i++) {
    - c9 <=> 0.78824
    - ca <=> 0.79216
    - cb <=> 0.79608
    - **cc** <=> 0.8
    - **cc <=> 0.8**
    - cd <=> 0.80392
    - ce <=> 0.80784
    - cf <=> 0.81176
    @@ -232,7 +232,7 @@ for (i=0; i<256; i++) {
    - da <=> 0.8549
    - db <=> 0.85882
    - dc <=> 0.86275
    - **dd** <=> 0.86667
    - **dd <=> 0.86667**
    - de <=> 0.87059
    - df <=> 0.87451
    - e0 <=> 0.87843
    @@ -249,7 +249,7 @@ for (i=0; i<256; i++) {
    - eb <=> 0.92157
    - ec <=> 0.92549
    - ed <=> 0.92941
    - **ee** <=> 0.93333
    - **ee <=> 0.93333**
    - ef <=> 0.93725
    - f0 <=> 0.94118
    - f1 <=> 0.9451
    @@ -266,4 +266,5 @@ for (i=0; i<256; i++) {
    - fc <=> 0.98824
    - fd <=> 0.99216
    - fe <=> 0.99608
    - **ff** <=> 1
    - **ff <=> 1**

  5. remitbri created this gist Mar 24, 2015.
    269 changes: 269 additions & 0 deletions gistfile1.md
    Original file line number Diff line number Diff line change
    @@ -0,0 +1,269 @@
    # hexa to alpha
    Useful for colour values, the 'AA' in #RRGGBBAA

    alpha = parseInt(hexa,16)/255

    ```js
    for (i=0; i<256; i++) {
    var deci = i/255
    var hex = i.toString(16)
    console.log(hex, deci)
    }
    ```


    - 01 <=> 0.00392
    - 02 <=> 0.00784
    - 03 <=> 0.01176
    - 04 <=> 0.01569
    - 05 <=> 0.01961
    - 06 <=> 0.02353
    - 07 <=> 0.02745
    - 08 <=> 0.03137
    - 09 <=> 0.03529
    - 0a <=> 0.03922
    - 0b <=> 0.04314
    - 0c <=> 0.04706
    - 0d <=> 0.05098
    - 0e <=> 0.0549
    - 0f <=> 0.05882
    - 10 <=> 0.06275
    - **11** <=> 0.06667
    - 12 <=> 0.07059
    - 13 <=> 0.07451
    - 14 <=> 0.07843
    - 15 <=> 0.08235
    - 16 <=> 0.08627
    - 17 <=> 0.0902
    - 18 <=> 0.09412
    - 19 <=> 0.09804
    - 1a <=> 0.10196
    - 1b <=> 0.10588
    - 1c <=> 0.1098
    - 1d <=> 0.11373
    - 1e <=> 0.11765
    - 1f <=> 0.12157
    - 20 <=> 0.12549
    - 21 <=> 0.12941
    - **22** <=> 0.13333
    - 23 <=> 0.13725
    - 24 <=> 0.14118
    - 25 <=> 0.1451
    - 26 <=> 0.14902
    - 27 <=> 0.15294
    - 28 <=> 0.15686
    - 29 <=> 0.16078
    - 2a <=> 0.16471
    - 2b <=> 0.16863
    - 2c <=> 0.17255
    - 2d <=> 0.17647
    - 2e <=> 0.18039
    - 2f <=> 0.18431
    - 30 <=> 0.18824
    - 31 <=> 0.19216
    - 32 <=> 0.19608
    - **33** <=> 0.2
    - 34 <=> 0.20392
    - 35 <=> 0.20784
    - 36 <=> 0.21176
    - 37 <=> 0.21569
    - 38 <=> 0.21961
    - 39 <=> 0.22353
    - 3a <=> 0.22745
    - 3b <=> 0.23137
    - 3c <=> 0.23529
    - 3d <=> 0.23922
    - 3e <=> 0.24314
    - 3f <=> 0.24706
    - 40 <=> 0.25098
    - 41 <=> 0.2549
    - 42 <=> 0.25882
    - 43 <=> 0.26275
    - **44** <=> 0.26667
    - 45 <=> 0.27059
    - 46 <=> 0.27451
    - 47 <=> 0.27843
    - 48 <=> 0.28235
    - 49 <=> 0.28627
    - 4a <=> 0.2902
    - 4b <=> 0.29412
    - 4c <=> 0.29804
    - 4d <=> 0.30196
    - 4e <=> 0.30588
    - 4f <=> 0.3098
    - 50 <=> 0.31373
    - 51 <=> 0.31765
    - 52 <=> 0.32157
    - 53 <=> 0.32549
    - 54 <=> 0.32941
    - **55** <=> 0.33333
    - 56 <=> 0.33725
    - 57 <=> 0.34118
    - 58 <=> 0.3451
    - 59 <=> 0.34902
    - 5a <=> 0.35294
    - 5b <=> 0.35686
    - 5c <=> 0.36078
    - 5d <=> 0.36471
    - 5e <=> 0.36863
    - 5f <=> 0.37255
    - 60 <=> 0.37647
    - 61 <=> 0.38039
    - 62 <=> 0.38431
    - 63 <=> 0.38824
    - 64 <=> 0.39216
    - 65 <=> 0.39608
    - **66** <=> 0.4
    - 67 <=> 0.40392
    - 68 <=> 0.40784
    - 69 <=> 0.41176
    - 6a <=> 0.41569
    - 6b <=> 0.41961
    - 6c <=> 0.42353
    - 6d <=> 0.42745
    - 6e <=> 0.43137
    - 6f <=> 0.43529
    - 70 <=> 0.43922
    - 71 <=> 0.44314
    - 72 <=> 0.44706
    - 73 <=> 0.45098
    - 74 <=> 0.4549
    - 75 <=> 0.45882
    - 76 <=> 0.46275
    - **77** <=> 0.46667
    - 78 <=> 0.47059
    - 79 <=> 0.47451
    - 7a <=> 0.47843
    - 7b <=> 0.48235
    - 7c <=> 0.48627
    - 7d <=> 0.4902
    - 7e <=> 0.49412
    - 7f <=> 0.49804
    - 80 <=> 0.50196
    - 81 <=> 0.50588
    - 82 <=> 0.5098
    - 83 <=> 0.51373
    - 84 <=> 0.51765
    - 85 <=> 0.52157
    - 86 <=> 0.52549
    - 87 <=> 0.52941
    - **88** <=> 0.53333
    - 89 <=> 0.53725
    - 8a <=> 0.54118
    - 8b <=> 0.5451
    - 8c <=> 0.54902
    - 8d <=> 0.55294
    - 8e <=> 0.55686
    - 8f <=> 0.56078
    - 90 <=> 0.56471
    - 91 <=> 0.56863
    - 92 <=> 0.57255
    - 93 <=> 0.57647
    - 94 <=> 0.58039
    - 95 <=> 0.58431
    - 96 <=> 0.58824
    - 97 <=> 0.59216
    - 98 <=> 0.59608
    - **99** <=> 0.6
    - 9a <=> 0.60392
    - 9b <=> 0.60784
    - 9c <=> 0.61176
    - 9d <=> 0.61569
    - 9e <=> 0.61961
    - 9f <=> 0.62353
    - a0 <=> 0.62745
    - a1 <=> 0.63137
    - a2 <=> 0.63529
    - a3 <=> 0.63922
    - a4 <=> 0.64314
    - a5 <=> 0.64706
    - a6 <=> 0.65098
    - a7 <=> 0.6549
    - a8 <=> 0.65882
    - a9 <=> 0.66275
    - **aa** <=> 0.66667
    - ab <=> 0.67059
    - ac <=> 0.67451
    - ad <=> 0.67843
    - ae <=> 0.68235
    - af <=> 0.68627
    - b0 <=> 0.6902
    - b1 <=> 0.69412
    - b2 <=> 0.69804
    - b3 <=> 0.70196
    - b4 <=> 0.70588
    - b5 <=> 0.7098
    - b6 <=> 0.71373
    - b7 <=> 0.71765
    - b8 <=> 0.72157
    - b9 <=> 0.72549
    - ba <=> 0.72941
    - **bb** <=> 0.73333
    - bc <=> 0.73725
    - bd <=> 0.74118
    - be <=> 0.7451
    - bf <=> 0.74902
    - c0 <=> 0.75294
    - c1 <=> 0.75686
    - c2 <=> 0.76078
    - c3 <=> 0.76471
    - c4 <=> 0.76863
    - c5 <=> 0.77255
    - c6 <=> 0.77647
    - c7 <=> 0.78039
    - c8 <=> 0.78431
    - c9 <=> 0.78824
    - ca <=> 0.79216
    - cb <=> 0.79608
    - **cc** <=> 0.8
    - cd <=> 0.80392
    - ce <=> 0.80784
    - cf <=> 0.81176
    - d0 <=> 0.81569
    - d1 <=> 0.81961
    - d2 <=> 0.82353
    - d3 <=> 0.82745
    - d4 <=> 0.83137
    - d5 <=> 0.83529
    - d6 <=> 0.83922
    - d7 <=> 0.84314
    - d8 <=> 0.84706
    - d9 <=> 0.85098
    - da <=> 0.8549
    - db <=> 0.85882
    - dc <=> 0.86275
    - **dd** <=> 0.86667
    - de <=> 0.87059
    - df <=> 0.87451
    - e0 <=> 0.87843
    - e1 <=> 0.88235
    - e2 <=> 0.88627
    - e3 <=> 0.8902
    - e4 <=> 0.89412
    - e5 <=> 0.89804
    - e6 <=> 0.90196
    - e7 <=> 0.90588
    - e8 <=> 0.9098
    - e9 <=> 0.91373
    - ea <=> 0.91765
    - eb <=> 0.92157
    - ec <=> 0.92549
    - ed <=> 0.92941
    - **ee** <=> 0.93333
    - ef <=> 0.93725
    - f0 <=> 0.94118
    - f1 <=> 0.9451
    - f2 <=> 0.94902
    - f3 <=> 0.95294
    - f4 <=> 0.95686
    - f5 <=> 0.96078
    - f6 <=> 0.96471
    - f7 <=> 0.96863
    - f8 <=> 0.97255
    - f9 <=> 0.97647
    - fa <=> 0.98039
    - fb <=> 0.98431
    - fc <=> 0.98824
    - fd <=> 0.99216
    - fe <=> 0.99608
    - **ff** <=> 1