Skip to content

Commit

Permalink
Merge branch 'release/v0.4.0'
Browse files Browse the repository at this point in the history
  • Loading branch information
KamiKillertO committed Apr 1, 2017
2 parents dd2cc55 + ef16a36 commit a0f9156
Show file tree
Hide file tree
Showing 23 changed files with 1,566 additions and 593 deletions.
3 changes: 2 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,9 +17,10 @@ before_install:
sh -e /etc/init.d/xvfb start;
sleep 3;
fi
- curl -o- -L https://yarnpkg.com/install.sh | bash
- export PATH=$HOME/.yarn/bin:$PATH

install:
- npm install -g yarn
- yarn
- yarn run vscode:prepublish

Expand Down
4 changes: 2 additions & 2 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"args": ["--extensionDevelopmentPath=${workspaceRoot}" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/src",
"outFiles": [ "${workspaceRoot}/out/src/**/*.js" ],
"preLaunchTask": "npm"
},
{
Expand All @@ -21,7 +21,7 @@
"args": ["--extensionDevelopmentPath=${workspaceRoot}", "--extensionTestsPath=${workspaceRoot}/out/test" ],
"stopOnEntry": false,
"sourceMaps": true,
"outDir": "${workspaceRoot}/out/test",
"outFiles": [ "${workspaceRoot}/out/test/**/*.js" ],
"preLaunchTask": "npm"
}
]
Expand Down
15 changes: 13 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,16 @@
## 0.4.0

### Changed

- Colors extractions refacto
- Support for split view (fix #20)
- Colorize all colors in gradient statement (fix #11)

### Added

- Cross browser colors extraction (#12)
- Add settings options to easily add new languages support (fix #13)

## 0.3.2

- Add stylus and XML support
Expand All @@ -17,8 +30,6 @@
- Add rgb(a) color extraction
- Add rgb and luminance properties in color.ts

## 0.2.1

## 0.2.0

### Added
Expand Down
84 changes: 72 additions & 12 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,40 +2,105 @@

[![codebeat badge](https://codebeat.co/badges/aec222e1-64ae-4360-a849-d077040694ca)](https://codebeat.co/projects/github-com-kamikillerto-vscode-colorize) [![Build Status](https://travis-ci.org/KamiKillertO/vscode-colorize.svg?branch=master)](https://travis-ci.org/KamiKillertO/vscode-colorize) [![Build status](https://ci.appveyor.com/api/projects/status/errygb6n97kiq75a?svg=true)](https://ci.appveyor.com/project/KamiKillertO/vscode-colorize) [![Licence](https://img.shields.io/github/license/KamiKillertO/vscode_colorize.svg)](https://github.com/KamiKillertO/vscode_colorize) ![VS Code Marketplace](http://vsmarketplacebadge.apphb.com/version-short/kamikillerto.vscode-colorize.svg)

Instantly visualize css colors in your css/sass/less/postcss/stylus/XML files.
Instantly visualize css colors in your css/sass/less/postcss/stylus/XML... files.

This extension your styles files looking for colors and generate a colored background (using the color) for each of them.

![](https://raw.githubusercontent.com/kamikillerto/vscode-colorize/master/assets/demo.gif)

## Features

- 🆕 Generate colored background for cross browsers colors
- Generate colored background for css hexa color
- 🆕 Generate colored background for rgb hexa color
- 🆕 Generate colored background for rgba hexa color
- Generate colored background for rgb hexa color
- Generate colored background for rgba hexa color
- Update the background when the color is updated

## Options

The following Visual Studio Code settings are available for the Colorize extension.
These can be set in user preferences `(cmd+,)` or workspace settings `(.vscode/settings.json)`.


```json
{
"colorize.languages": [
"css",
"sass",
"scss",
"less",
"pcss",
"sss",
"stylus",
"xml",
"svg"
],
"colorize.files_extensions": []
}
```

⚠️ Reload needed after changes ️️️️⚠️

### colorize.languages _ARRAY_

Modified this option to add or remove support for a [language](https://code.visualstudio.com/docs/languages/overview).

For example if you want to add `javascript`:

```json
"colorize.languages": [
"javascript",
"css",
"sass",
"scss",
"less",
"pcss",
"sss",
"stylus",
"xml",
"svg"
]
```

### colorize.files_extensions _ARRAY_

Modified this option to activate colorize for files with the matching extension.

For example if you want to colorize `.diff` files:

```json
"colorize.languages": [
".diff"
]
```

## Roadmap

- [x] Generate background for hexa colors
- [x] Update background on color updates
- [x] Generate background for rgb colors
- [~] Generate background for rgba colors
- [x] Generate background for rgba colors (~ missing transparency)
- [ ] Generate background for hsl colors
- [ ] Generate background for hsla colors
- [ ] Generate background for Predefined/Cross-browser colors
- [x] Generate background for Predefined/Cross-browser colors
- [ ] Generate background for preprocessor variables
- [ ] Generate background for css variables

## Release Notes

### Latest 0.4.0 (2017.04.01)

- Generate background for cross browsers colors (white, black...)
- Add settings to easily add support for new languages
- Fix several issues and improve performance

### Latest 0.3.2 (2017.02.23)

- Stylus support
- XML support
- Fix some background update issues

### Latest 0.3.1 (2017.02.08)
### 0.3.1 (2017.02.08)

- Fix an issue where one space after rgb(a) colors was included in the colored background
- Speed up colored background generation for long files
Expand All @@ -46,14 +111,9 @@ This extension your styles files looking for colors and generate a colored back
- Generate background for RGB colors
- Generate background for RGBa colors

### 0.2.1 (2017.01.26)

- Fix some background update issues

### 0.2.0 (2017.01.25)

- Huge code refacto
- Dramatically improvement colored background updates
- Improvement colored background updates

### 0.1.0 (2017.01.17)

Expand Down
Binary file modified assets/demo.gif
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
63 changes: 43 additions & 20 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@
"name": "vscode-colorize",
"displayName": "colorize",
"description": "A vscode extension to help visualize css colors in files.",
"version": "0.3.2",
"version": "0.4.0",
"publisher": "kamikillerto",
"license": "Apache-2.0",
"icon": "assets/logo.png",
"engines": {
"vscode": "^1.5.0"
"vscode": "^1.10.0"
},
"categories": [
"Other"
Expand All @@ -32,37 +32,60 @@
"theme": "light"
},
"activationEvents": [
"onLanguage:css",
"onLanguage:sass",
"onLanguage:scss",
"onLanguage:less",
"onLanguage:pcss",
"onLanguage:sss",
"onLanguage:stylus",
"onLanguage:styl",
"onLanguage:xml"
"*"
],
"main": "./out/src/extension",
"contributes": {
"commands": []
"configuration": {
"title": "Colorize extension (reboot after any changes required)",
"properties": {

"colorize.languages": {
"default": [
"css",
"sass",
"scss",
"less",
"pcss",
"sss",
"stylus",
"xml",
"svg"
],
"title": "Colorize files with these languages",
"type": "array",
"description": "Languages that should be colorized"
},
"colorize.files_extensions": {
"$schema": "http://json-schema.org/draft-04/schema#",
"default": [],
"title": "Colorize files with these extensions",
"type": "array",
"items": {
"type": "string",
"pattern": "\\.\\w+$",
"description": "You should enter a valid file extension"
},
"description": "Specified files extension that should be colorized"
}
}
}
},
"scripts": {
"vscode:prepublish": "tsc -p ./",
"compile": "tsc -p ./",
"watch": "tsc -watch -p ./",
"compile": "tsc -watch -p ./",
"postinstall": "node ./node_modules/vscode/bin/install",
"lint": "node ./node_modules/tslint/lib/tslint-cli.js -c tslint.json --project tsconfig.json",
"test": "node ./node_modules/vscode/bin/test"
},
"devDependencies": {
"@types/chai": "3.4.34",
"@types/mocha": "2.2.37",
"@types/node": "6.0.60",
"@types/chai": "3.4.35",
"@types/mocha": "2.2.40",
"@types/node": "7.0.12",
"chai": "3.5.0",
"mocha": "3.2.0",
"node-pre-gyp": "0.6.32",
"tslint": "4.3.1",
"typescript": "2.1.5",
"vscode": "1.0.3"
"typescript": "2.2.2",
"vscode": "1.0.6"
}
}
7 changes: 4 additions & 3 deletions src/color-decoration.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import {
} from 'vscode';

import ColorUtil from './color-util';
import Color from './color';
import Color from './util/color';

class ColorDecoration {
public color: Color;
Expand All @@ -20,6 +20,7 @@ class ColorDecoration {
}

public dispose(): void {
this.color = null;
this.decoration.dispose();
}

Expand All @@ -38,8 +39,8 @@ class ColorDecoration {
let backgroundDecorationType = window.createTextEditorDecorationType({
borderWidth: "1px",
borderStyle: "solid",
borderColor: this.color.toRGBString(),
backgroundColor: this.color.toRGBString(),
borderColor: this.color.toRgbString(),
backgroundColor: this.color.toRgbString(),
color: textColor
});
this.decoration = backgroundDecorationType;
Expand Down
15 changes: 0 additions & 15 deletions src/color-regex.ts

This file was deleted.

Loading

0 comments on commit a0f9156

Please sign in to comment.