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

Color Calibration Web App #1797

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Conversation

350d
Copy link

@350d 350d commented Nov 14, 2024

Simple Web app for semi auto color calibration.
Instruction available here

Summary

What kind of change does this PR introduce? (check at least one)

  • Bugfix
  • Feature
  • Code style update
  • Refactor
  • Docs
  • Build-related changes
  • Other, please describe:

If changing the UI of web configuration, please provide the before/after screenshot:

Does this PR introduce a breaking change? (check one)

  • Yes
  • No

If yes, please describe the impact and migration path for existing setups:

The PR fulfills these requirements:

  • When resolving a specific issue, it's referenced in the PR's body (e.g. Fixes: #xxx[,#xxx], where "xxx" is the issue number)

If adding a new feature, the PR's description includes:

  • A convincing reason for adding this feature
  • Related documents have been updated (docs/docs/en)
  • Related tests have been updated

PLEASE DON'T FORGET TO ADD YOUR CHANGES TO CHANGELOG.MD

  • Yes, CHANGELOG.md is also updated

To avoid wasting your time, it's best to open a feature request issue first and wait for approval before working on it.

Other information:


function update_hyperion_adjustments() {
hyperion_api(null, function(json){
CURRENT_ADJUSTMENT = json.info.adjustment[0];

Check warning

Code scanning / CodeQL

Missing variable declaration Warning

Variable CURRENT_ADJUSTMENT is used like a local variable, but is missing a declaration.

get_video();
//update_canvas();
})

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (95% of all statements in
the enclosing script
have an explicit semicolon).
WALL_COLOR = color;
WALL_COLOR_LED.style.backgroundColor = color.hex;

var hsl_tv = rgb_to_hsl(TV_COLOR.value[0], TV_COLOR.value[1], TV_COLOR.value[2]);

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable hsl_tv.
WALL_COLOR_LED.style.backgroundColor = color.hex;

var hsl_tv = rgb_to_hsl(TV_COLOR.value[0], TV_COLOR.value[1], TV_COLOR.value[2]);
var hsl_wall = rgb_to_hsl(WALL_COLOR.value[0], WALL_COLOR.value[1], WALL_COLOR.value[2]);

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable hsl_wall.
wall_rgb = WALL_COLOR.value.slice(0,3).map(function(n){return Math.max(n,1)}),
tv_rgb_min = Math.max(1, Math.min(...tv_rgb)),
wall_rgb_min = Math.max(1, Math.min(...wall_rgb)),
tv_rgb_max = Math.max(1, Math.max(...tv_rgb)),

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable tv_rgb_max.


var rgb_multiplier = 1,
accuracy_multiplier = [];

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable accuracy_multiplier.

if (CALIBRATION_MODE_AUTO == 'blue') {

rgb_multiplier = tv_rgb[2] / wall_rgb[2];

Check warning

Code scanning / CodeQL

Useless assignment to local variable Warning

The value assigned to rgb_multiplier here is unused.

NEW_RGB[0] = Math.round(255 * tv_rgb[0] / wall_rgb[0]);
NEW_RGB[1] = Math.round(Math.max(1, CURRENT_RGB[1]) * tv_rgb[1] / wall_rgb[1]);
NEW_RGB[2] = Math.round(255 * tv_rgb[2] / wall_rgb[2])

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (98% of all statements in
the enclosing function
have an explicit semicolon).
// normalize new rgb

var new_rgb_max = Math.max(...NEW_RGB),
new_rgb_min = Math.min(...NEW_RGB);

Check notice

Code scanning / CodeQL

Unused variable, import, function or class Note

Unused variable new_rgb_min.
x = (x > 0.008856) ? Math.pow(x, 1/3) : (7.787 * x) + 16/116;
y = (y > 0.008856) ? Math.pow(y, 1/3) : (7.787 * y) + 16/116;
z = (z > 0.008856) ? Math.pow(z, 1/3) : (7.787 * z) + 16/116;
return [(116 * y) - 16, 500 * (x - y), 200 * (y - z)]

Check notice

Code scanning / CodeQL

Semicolon insertion Note

Avoid automated semicolon insertion (90% of all statements in
the enclosing function
have an explicit semicolon).
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant