~ubuntu-branches/ubuntu/maverick/grafx2/maverick

« back to all changes in this revision

Viewing changes to share/grafx2/scripts/pal_db_Set6bit.lua

  • Committer: Bazaar Package Importer
  • Author(s): Gürkan Sengün
  • Date: 2010-03-22 12:07:47 UTC
  • mfrom: (1.1.3 upstream)
  • Revision ID: james.westby@ubuntu.com-20100322120747-g0jel6vf6mjkc53s
Tags: 2.2-1
* New upstream version, fixes FTBFS with binutils-gold. (Closes: #554742)
* Bump standards version to 3.8.4.
* debian/control: Add liblua5.1-0-dev and pkg-config to build depends.
* debian/rules: Drop dh_desktop call.
* debian/copyright: Update years.
* Switch to dpkg-source format version 3.0 (quilt).
* debian/watch: Added.
* Added patch to fix spelling errors in source code.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
--PALETTE Set: Full 6 Bit (64 colors)
 
2
--by Richard Fhager 
 
3
--http://hem.fyristorg.com/dawnbringer/
 
4
 
 
5
-- Copyright 2010 Richard Fhager
 
6
--
 
7
-- This program is free software; you can redistribute it and/or
 
8
-- modify it under the terms of the GNU General Public License
 
9
-- as published by the Free Software Foundation; version 2
 
10
-- of the License. See <http://www.gnu.org/licenses/>
 
11
 
 
12
 
 
13
-- Generate palette of all colors possible with a given number of shades for each channel
 
14
-- 2 shades = 1 bit / channel = 3 bit palette = 2^3 colors =  8 colors
 
15
-- 4 shades = 2 bit / channel = 6 bit palette = 2^6 colors = 64 colors
 
16
 
 
17
-- Channel shades (shades = 2 ^ bit-depth)
 
18
shades = 4
 
19
 
 
20
mult = 255 / (shades-1)
 
21
 
 
22
 
 
23
colors = {}
 
24
col = 0
 
25
for r = 0, shades-1, 1 do
 
26
  for g = 0, shades-1, 1 do
 
27
    for b = 0, shades-1, 1 do
 
28
       col = col + 1
 
29
       colors[col] = { r*mult, g*mult, b*mult } 
 
30
    end
 
31
  end
 
32
end
 
33
 
 
34
 
 
35
for c = 1, #colors, 1 do
 
36
 
 
37
  setcolor(c-1,colors[c][1],colors[c][2],colors[c][3]) 
 
38
 
 
39
end