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

Adds RGB control feature #262

Closed

Conversation

mateocervilla
Copy link

@mateocervilla mateocervilla commented Dec 31, 2022

Description

This pull request adds the arguments required for setting RGB values on some headsets and the implementation for the Logitech G733.
This development was carried out on a Logitech G733 on Linux.

Configuration options

headsetcontrol -R Sets Red channel light color, values must be between 0 and 255

headsetcontrol -G Sets Green channel light color, values must be between 0 and 255

headsetcontrol -B Sets Blue channel light color, values must be between 0 and 255

headsetcontrol -t 0|1 Sets top light color. Use it with -R -G -B. Default: Bottom (0 = bottom, 1 = top)

Examples

  • Set bottom rgb light to purple:

headsetcontrol -R 255 -B 255

  • Set top rgb light to green:

headsetcontrol -G 255 -t

Clarifications

  • RGB colors are scaled. I had to get every value from 0 to 255 and fit a polynomial line. So in the code it was necessary to use a polynomial function to set the final values.
  • This function was implemented on the file for the Logitech devices {G633, G635, G933, G935, G733} but only tested on a G733.
  • It is possible that other devices may not use the -t (top) argument or may set more than two lights, so when the time comes, it must be changed. Perhaps a light index could be instead.

@Sapd
Copy link
Owner

Sapd commented Jan 10, 2023

If all color values are required anyway (rgb), it might make sense to put them into one argument, like --colors 255,255,255 (like on the equaliser). But Im open for discussion here.

Im not sure how the polynomial function was created, but you also might consider using splines, which are simpler and more transparent (if applicable in this case, as this wouldnt be a "smooth" curve then): #197 (comment)

@mateocervilla
Copy link
Author

mateocervilla commented Jan 10, 2023

it might make sense to put them into one argument, like --colors 255,255,255 (like on the equaliser). But Im open for discussion here.

That's a good idea actually. I had also thought about setting the colors with their hex codes (--colors FF55AA)

how the polynomial function was created

I sent from the Windows Logitech G Hub all the values from 0 to 255 (changing one color channel) and saved every hex value from wireshark. Then I created a table with its respective graph and I calculated a curve that fits the points.

I did something like this guy did (which also has an interesting repo):

Copy link

github-actions bot commented Nov 7, 2023

This PR is stale because it has been open 300 days with no activity. Remove stale label or comment or this will be closed in 60 days.

@github-actions github-actions bot added the Stale label Nov 7, 2023
Copy link

github-actions bot commented Jan 6, 2024

This PR was closed because it has been stalled with no activity.

@github-actions github-actions bot closed this Jan 6, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants