Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Italy map added #230

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
2 changes: 1 addition & 1 deletion examples/normal-usage.js
Original file line number Diff line number Diff line change
Expand Up @@ -78,4 +78,4 @@ console.log('this is a warning'.warn);
console.log('this is an input'.input);

// console.log("Don't summon".zalgo)

console.log('Io sono Italiano! :D '.italy);
3 changes: 3 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@ export interface Color {
rainbow: Color;
zebra: Color;
america: Color;
italy: Color;
trap: Color;
random: Color;
zalgo: Color;
Expand Down Expand Up @@ -87,6 +88,7 @@ export const strikethrough: Color;
export const rainbow: Color;
export const zebra: Color;
export const america: Color;
export const italy: Color;
export const trap: Color;
export const random: Color;
export const zalgo: Color;
Expand Down Expand Up @@ -129,6 +131,7 @@ declare global {
rainbow: string;
zebra: string;
america: string;
italy: string;
trap: string;
random: string;
zalgo: string;
Expand Down
1 change: 1 addition & 0 deletions lib/colors.js
Original file line number Diff line number Diff line change
Expand Up @@ -184,6 +184,7 @@ colors.zalgo = require('./custom/zalgo');
// maps
colors.maps = {};
colors.maps.america = require('./maps/america');
colors.maps.italy = require('./maps/italy');
colors.maps.zebra = require('./maps/zebra');
colors.maps.rainbow = require('./maps/rainbow');
colors.maps.random = require('./maps/random');
Expand Down
4 changes: 4 additions & 0 deletions lib/extendStringPrototype.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,10 @@ module['exports'] = function() {
return colors.america(this);
});

addProperty('italy', function() {
return colors.italy(this);
});

//
// Iterate through all default styles and colors
//
Expand Down
12 changes: 12 additions & 0 deletions lib/maps/italy.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
var colors = require('../colors');

module['exports'] = (function() {
return function(letter, i, exploded) {
if (letter === ' ') return letter;
switch (i%3) {
case 0: return colors.black.bgGreen(letter);
case 1: return colors.black.bgWhite(letter);
case 2: return colors.black.bgRed(letter);
}
};
})();