nixcolor 0.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/nixcolor.rb +31 -0
- metadata +65 -0
data/lib/nixcolor.rb
ADDED
@@ -0,0 +1,31 @@
|
|
1
|
+
class NixColor
|
2
|
+
|
3
|
+
def self.rgb(red, green, blue)
|
4
|
+
16 + (red * 36) + (green * 6) + blue
|
5
|
+
end
|
6
|
+
|
7
|
+
def self.bg color
|
8
|
+
"\x1b[48;5;#{color}m"
|
9
|
+
end
|
10
|
+
|
11
|
+
def self.fg color
|
12
|
+
"\x1b[48;5;#{color}m"
|
13
|
+
end
|
14
|
+
|
15
|
+
def self.background color
|
16
|
+
self.bg color
|
17
|
+
end
|
18
|
+
|
19
|
+
def self.foreground color
|
20
|
+
self.fg color
|
21
|
+
end
|
22
|
+
|
23
|
+
def self.clear_color
|
24
|
+
"\x1b[0m" # Clear Colors
|
25
|
+
end
|
26
|
+
|
27
|
+
def self.clear
|
28
|
+
"\e[2J\e[1;1H" # Clear Screen, return Cursor
|
29
|
+
end
|
30
|
+
|
31
|
+
end
|
metadata
ADDED
@@ -0,0 +1,65 @@
|
|
1
|
+
--- !ruby/object:Gem::Specification
|
2
|
+
name: nixcolor
|
3
|
+
version: !ruby/object:Gem::Version
|
4
|
+
hash: 29
|
5
|
+
prerelease:
|
6
|
+
segments:
|
7
|
+
- 0
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 0.0.1
|
11
|
+
platform: ruby
|
12
|
+
authors:
|
13
|
+
- Roman Pramberger
|
14
|
+
autorequire:
|
15
|
+
bindir: bin
|
16
|
+
cert_chain: []
|
17
|
+
|
18
|
+
date: 2012-05-30 00:00:00 Z
|
19
|
+
dependencies: []
|
20
|
+
|
21
|
+
description: Yet another 255 Ansi colors for ruby gem
|
22
|
+
email: roman.pramberger@gmail.com
|
23
|
+
executables: []
|
24
|
+
|
25
|
+
extensions: []
|
26
|
+
|
27
|
+
extra_rdoc_files: []
|
28
|
+
|
29
|
+
files:
|
30
|
+
- lib/nixcolor.rb
|
31
|
+
homepage: http://rubygems.org/gems/nixcolor
|
32
|
+
licenses: []
|
33
|
+
|
34
|
+
post_install_message:
|
35
|
+
rdoc_options: []
|
36
|
+
|
37
|
+
require_paths:
|
38
|
+
- lib
|
39
|
+
required_ruby_version: !ruby/object:Gem::Requirement
|
40
|
+
none: false
|
41
|
+
requirements:
|
42
|
+
- - ">="
|
43
|
+
- !ruby/object:Gem::Version
|
44
|
+
hash: 3
|
45
|
+
segments:
|
46
|
+
- 0
|
47
|
+
version: "0"
|
48
|
+
required_rubygems_version: !ruby/object:Gem::Requirement
|
49
|
+
none: false
|
50
|
+
requirements:
|
51
|
+
- - ">="
|
52
|
+
- !ruby/object:Gem::Version
|
53
|
+
hash: 3
|
54
|
+
segments:
|
55
|
+
- 0
|
56
|
+
version: "0"
|
57
|
+
requirements: []
|
58
|
+
|
59
|
+
rubyforge_project:
|
60
|
+
rubygems_version: 1.7.2
|
61
|
+
signing_key:
|
62
|
+
specification_version: 3
|
63
|
+
summary: Unix (Ansi) color gem
|
64
|
+
test_files: []
|
65
|
+
|