keyboard

package
v0.4.7 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jun 5, 2022 License: MIT Imports: 12 Imported by: 0

Documentation

Overview

Package keyboard provides helpers to interact with System76 keyboard devices.

Index

Constants

View Source
const RandomColor = "random"

RandomColor is the color name used to pick a randomly generated color code.

Variables

This section is empty.

Functions

func BrightnessFileHandler

func BrightnessFileHandler(c string) error

BrightnessFileHandler writes a hex value to brightness and returns the bytes written.

func ColorFileHandler

func ColorFileHandler(color string) error

ColorFileHandler writes a string to colorFiles.

func EachPresetColor

func EachPresetColor(cb func(name, value string))

EachPresetColor iterates all the loaded color names and invokes the provided callback for each one.

func GetCurrentBrightness

func GetCurrentBrightness() (string, error)

GetCurrentBrightness reads the brightness value current set and returns its value.

func GetCurrentColors

func GetCurrentColors() (map[string]string, error)

GetCurrentColors reads the color values currently set and returns their values.

func LoadEmbeddedColors

func LoadEmbeddedColors() error

LoadEmbeddedColors will parse the embedded colors file into memory for looking up color hex codes by name.

Types

type RGBColor

type RGBColor struct {
	Red   int
	Green int
	Blue  int
}

RGBColor represents Red Green and Blue values of a color

func (RGBColor) GetColorInHex

func (c RGBColor) GetColorInHex() string

GetColorInHex returns a color in HEX format

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL