Skip to content

Commit

Permalink
Merge pull request #330 from rdkcentral/dev
Browse files Browse the repository at this point in the history
v5.0.0
  • Loading branch information
michielvandergeest authored Aug 22, 2022
2 parents 82b8948 + 0ed3348 commit 8c112b9
Show file tree
Hide file tree
Showing 47 changed files with 6,374 additions and 3,979 deletions.
12 changes: 12 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v5.0.0

*22 aug 2022*

- Moved Metrological and Platform specific plugins to [metrological-sdk](https://github.com/Metrological/metrological-sdk) (Metadata, Metrics, Pin, Profile, Purchase, TV, VideoPlayer)
- Added base 64 image support for Image plugin
- Fixed bug in Image plugin as Img cover stretches image
- Fixed named route property not being accessed properly
- Added/Updated Router available methods
- Added Accessibility plugin with support for ColorShifting (color blindness filter)


## v4.8.3

*19 apr 2022*
Expand Down
2 changes: 1 addition & 1 deletion docs/_sidebar.md
Original file line number Diff line number Diff line change
@@ -1,13 +1,13 @@
- [Getting started](/getting-started.md)

- Plugins
- [Accessibility](/plugins/accessibility.md)
- [Utils](/plugins/utils.md)
- [Storage](/plugins/storage.md)
- [Settings](/plugins/settings.md)
- [Log](/plugins/log.md)
- [Metadata](/plugins/metadata.md)
- [Metrics](/plugins/metrics.md)
- [Metadata](/plugins/metadata.md)
- [Profile](/plugins/profile.md)
- [Purchase](/plugins/purchase.md)
- [Language](/plugins/language.md)
Expand Down
12 changes: 12 additions & 0 deletions docs/changelog.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## v5.0.0

*22 aug 2022*

- Moved Metrological and Platform specific plugins to [metrological-sdk](https://github.com/Metrological/metrological-sdk) (Metadata, Metrics, Pin, Profile, Purchase, TV, VideoPlayer)
- Added base 64 image support for Image plugin
- Fixed bug in Image plugin as Img cover stretches image
- Fixed named route property not being accessed properly
- Added/Updated Router available methods
- Added Accessibility plugin with support for ColorShifting (color blindness filter)


## v4.8.3

*19 apr 2022*
Expand Down
2 changes: 1 addition & 1 deletion docs/getting-started.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ Next you can run the `lng build` and `lng serve` commands to build the blueprint

During development you might prefer using the `lng dev` command, which builds and launches your App, and then keeps watching for changes to automatically rebuild.

Whenever you want to review this documentation, you can run `lng docs` in the root of a project. This will open up the documention for the Lightning-SDK version used in that project.
Whenever you want to review this documentation, you can run `lng docs` in the root of a project. This will open up the documentation for the Lightning-SDK version used in that project.

## Fonts

Expand Down
13 changes: 13 additions & 0 deletions docs/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,20 +6,33 @@ The Reference Documentation for Lightning SDK contains detailed descriptions of

The available Lightning SDK plugins are, in alphabetical order:

<!---TOC_start--->
* [Colors](plugins/colors.md)
* [FPS Counter](plugins/fpscounter.md)
* [Image](plugins/image.md)
* [Language](plugins/language.md)
* [Lightning](plugins/lightning.md)
* [Log](plugins/log.md)
* [Metadata](plugins/metadata.md)
* [Metrics](plugins/metrics.md)
* [Pin](plugins/pin.md)
* [Profile](plugins/profile.md)
* [Purchase](plugins/purchase.md)
* [Registry](plugins/registry.md)
* [Router](plugins/router/index.md)
* [Configuration](plugins/router/configuration.md)
* [Navigation](plugins/router/navigation.md)
* [Data Providing](plugins/router/dataproviding.md)
* [Router Events](plugins/router/events.md)
* [Page Transitions](plugins/router/pagetransitions.md)
* [Widgets](plugins/router/widgets.md)
* [Settings](plugins/router/settings.md)
* [Deeplinking](plugins/router/deeplinking.md)
* [History](plugins/router/history.md)
* [Settings](plugins/settings.md)
* [Storage](plugins/storage.md)
* [TV](plugins/tv.md)
* [Utils](plugins/utils.md)
* [VersionLabel](plugins/versionlabel.md)
* [VideoPlayer](plugins/videoplayer.md)
<!---TOC_end--->
3 changes: 2 additions & 1 deletion docs/package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "@lightningjs/sdk",
"version": "4.8.3",
"version": "5.0.0",
"license": "Apache-2.0",
"scripts": {
"postinstall": "node ./scripts/postinstall.js",
Expand All @@ -23,6 +23,7 @@
"dependencies": {
"@babel/polyfill": "^7.11.5",
"@lightningjs/core": "*",
"@metrological/sdk": "github:metrological/metrological-sdk",
"@michieljs/execute-as-promise": "^1.0.0",
"deepmerge": "^4.2.2",
"localCookie": "github:WebPlatformForEmbedded/localCookie",
Expand Down
85 changes: 85 additions & 0 deletions docs/plugins/accessibility.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
# Accessibility

The Accessibility plugin provides functionality to easily make your App more accessible.

Currently it provides functionality to apply a **Colorshifting filter** to your App, helping people with different types of color blindness to properly use your App.

## Usage

The Accessibility plugin is automatically included in the root of your App. In most cases there is no need to specifically import the Accessibility plugin into your App code.

## Colorshift filter

When you want to apply a colorshift filter over your _entire App_, you can do so by calling the
`colorshift` method attached to the root `application`.

A reference to the root application is made available in every Lightning component (via `this.application`), allowing you to invoke this function from anywhere in your App.

### colorshift

Applies a color filter and optional _brightness_, _contrast_ and _gamma_ configuration.

```js
const type = 'deuteranopia'
const config = {
brightness: 18,
contrast: 69,
gamma: 42
}
this.application.colorshift(type, config)
```

#### type

Valid values for Colorshift types are:

- `deuteranopia` (red-green, green weak)
- `protanopia` (red-green, red weak)
- `tritanopia` (blue-yellow)
- `monochromacy` (grayscale)
- `normal` (normal vision)

When passing `false` the entire colorshift filter is disabled.

#### config

`config` is an object where the _brightness_, _contrast_ and _gamma_ of each color filter can be tweaked. The values are expected to be between `0` and `100`, and default to `50`.

It's not required to pass in the entire object. Keys that are omitted are automatically assumed to have the default value (of `50`).

The `normal` type color filter should be used for cases where you only want to adjust the brightness, contrast or gamma values, without applying any specific color blindness filter.


### Advanced use

The typical use of the colorshift filter is to apply it over the entire app (using `this.application.colorshift()`). But there may also be cases where you want to apply it only to a single element (for demo purposes or during in-app configuration of the color settings, for example).

In this case you should import the `Accessibility` plugin into your component.

```js
import { Accessibility } from '@lightningjs/sdk'
```

Next you can use the `colorshift` method similarly to the standard use. With the exception that the first argument refers to the Lightning element you want to apply the colorshift filter to.

```js
const type = 'protanopia'
const config = {
brightness: 54,
}
const element = this.tag('Logo')
Accessibility.colorshift(element, type, config)
```

Important to remember is that the element you apply the colorshift filter to shouldn't already have a _shader_ applied to it, nor can it have `rtt` set to `true`. In these cases you could create a wrapper and apply the colorshift filter to the wrapper instead.

<!--
Todo
### Colorshift configuration UX
To make it as easy as possible to make your App colorblindness friendly, we have made available a standard importable [UI component](...) to set and configure the colorshift settings for your App.
Feel free to use this UI component directly inside your App. Or use it as inspiration to build your own configuration screen.
-->
131 changes: 0 additions & 131 deletions docs/plugins/colors/index.md

This file was deleted.

Loading

0 comments on commit 8c112b9

Please sign in to comment.