mirror of
https://github.com/vsariola/sointu.git
synced 2025-06-04 01:28:45 -04:00
feat(tracker): make color scheme dark gray
This commit is contained in:
parent
92ab035101
commit
e480622f57
@ -41,7 +41,7 @@ func (t *Tracker) layoutRowMarkers(patternRows, sequenceLength, cursorRow, curso
|
|||||||
if songRow == cursorSongRow {
|
if songRow == cursorSongRow {
|
||||||
paint.ColorOp{Color: trackerActiveTextColor}.Add(gtx.Ops)
|
paint.ColorOp{Color: trackerActiveTextColor}.Add(gtx.Ops)
|
||||||
} else {
|
} else {
|
||||||
paint.ColorOp{Color: trackerInactiveTextColor}.Add(gtx.Ops)
|
paint.ColorOp{Color: trackerPatternRowTextColor}.Add(gtx.Ops)
|
||||||
}
|
}
|
||||||
op.Offset(f32.Pt(rowMarkerWidth/2, 0)).Add(gtx.Ops)
|
op.Offset(f32.Pt(rowMarkerWidth/2, 0)).Add(gtx.Ops)
|
||||||
widget.Label{}.Layout(gtx, textShaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", j)))
|
widget.Label{}.Layout(gtx, textShaper, trackerFont, trackerFontSize, strings.ToUpper(fmt.Sprintf("%02x", j)))
|
||||||
|
@ -11,12 +11,13 @@ import (
|
|||||||
var fontCollection []text.FontFace = gofont.Collection()
|
var fontCollection []text.FontFace = gofont.Collection()
|
||||||
var textShaper = text.NewCache(fontCollection)
|
var textShaper = text.NewCache(fontCollection)
|
||||||
|
|
||||||
var neutral = color.RGBA{R: 64, G: 39, B: 132, A: 255}
|
var neutral = color.RGBA{R: 64, G: 64, B: 64, A: 255}
|
||||||
var light = color.RGBA{R: 117, G: 75, B: 234, A: 255}
|
var light = color.RGBA{R: 128, G: 128, B: 128, A: 255}
|
||||||
var dark = color.RGBA{R: 25, G: 15, B: 51, A: 255}
|
var dark = color.RGBA{R: 15, G: 15, B: 15, A: 255}
|
||||||
var white = color.RGBA{R: 255, G: 255, B: 255, A: 255}
|
var white = color.RGBA{R: 255, G: 255, B: 255, A: 255}
|
||||||
var blue = color.RGBA{R: 127, G: 127, B: 255, A: 255}
|
var blue = color.RGBA{R: 127, G: 127, B: 255, A: 255}
|
||||||
var gray = color.RGBA{R: 127, G: 127, B: 127, A: 255}
|
var gray = color.RGBA{R: 133, G: 133, B: 133, A: 255}
|
||||||
|
var darkGray = color.RGBA{R: 30, G: 30, B: 30, A: 255}
|
||||||
var black = color.RGBA{R: 0, G: 0, B: 0, A: 255}
|
var black = color.RGBA{R: 0, G: 0, B: 0, A: 255}
|
||||||
var yellow = color.RGBA{R: 255, G: 255, B: 130, A: 255}
|
var yellow = color.RGBA{R: 255, G: 255, B: 130, A: 255}
|
||||||
var red = color.RGBA{R: 255, G: 0, B: 0, A: 255}
|
var red = color.RGBA{R: 255, G: 0, B: 0, A: 255}
|
||||||
@ -28,20 +29,21 @@ var panelLightColor = light
|
|||||||
var labelFont = fontCollection[6].Font
|
var labelFont = fontCollection[6].Font
|
||||||
var labelFontSize = unit.Px(18)
|
var labelFontSize = unit.Px(18)
|
||||||
|
|
||||||
var activeTrackColor = color.RGBA{0, 0, 50, 255}
|
var activeTrackColor = color.RGBA{R: 45, G: 45, B: 45, A: 255}
|
||||||
var inactiveTrackColor = black
|
var inactiveTrackColor = darkGray
|
||||||
|
|
||||||
var trackerFont = fontCollection[6].Font
|
var trackerFont = fontCollection[6].Font
|
||||||
var trackerFontSize = unit.Px(16)
|
var trackerFontSize = unit.Px(16)
|
||||||
var trackerInactiveTextColor = gray
|
var trackerInactiveTextColor = color.RGBA{R: 212, G: 212, B: 212, A: 255}
|
||||||
var trackerTextColor = white
|
var trackerTextColor = white
|
||||||
var trackerActiveTextColor = yellow
|
var trackerActiveTextColor = yellow
|
||||||
var trackerPlayColor = red
|
var trackerPatternRowTextColor = color.RGBA{R: 198, G: 198, B: 198, A: 255}
|
||||||
|
var trackerPlayColor = color.RGBA{R: 55, G: 55, B: 61, A: 255}
|
||||||
var trackerPatMarker = blue
|
var trackerPatMarker = blue
|
||||||
var trackerCursorColor = color.RGBA{R: 64, G: 64, B: 64, A: 64}
|
var trackerCursorColor = color.RGBA{R: 38, G: 79, B: 120, A: 64}
|
||||||
|
|
||||||
var patternBgColor = black
|
var patternBgColor = black
|
||||||
var patternPlayColor = red
|
var patternPlayColor = color.RGBA{R: 55, G: 55, B: 61, A: 255}
|
||||||
var patternTextColor = white
|
var patternTextColor = white
|
||||||
var patternActiveTextColor = yellow
|
var patternActiveTextColor = yellow
|
||||||
var patternFont = fontCollection[6].Font
|
var patternFont = fontCollection[6].Font
|
||||||
|
@ -21,15 +21,9 @@ func (t *Tracker) layoutTrack(patterns [][]byte, sequence []byte, active bool, c
|
|||||||
return func(gtx layout.Context) layout.Dimensions {
|
return func(gtx layout.Context) layout.Dimensions {
|
||||||
gtx.Constraints.Min.X = trackWidth
|
gtx.Constraints.Min.X = trackWidth
|
||||||
gtx.Constraints.Max.X = trackWidth
|
gtx.Constraints.Max.X = trackWidth
|
||||||
if active {
|
paint.FillShape(gtx.Ops, inactiveTrackColor, clip.Rect{
|
||||||
paint.FillShape(gtx.Ops, activeTrackColor, clip.Rect{
|
Max: gtx.Constraints.Max,
|
||||||
Max: gtx.Constraints.Max,
|
}.Op())
|
||||||
}.Op())
|
|
||||||
} else {
|
|
||||||
paint.FillShape(gtx.Ops, inactiveTrackColor, clip.Rect{
|
|
||||||
Max: gtx.Constraints.Max,
|
|
||||||
}.Op())
|
|
||||||
}
|
|
||||||
defer op.Push(gtx.Ops).Pop()
|
defer op.Push(gtx.Ops).Pop()
|
||||||
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
clip.Rect{Max: gtx.Constraints.Max}.Add(gtx.Ops)
|
||||||
op.Offset(f32.Pt(0, float32(gtx.Constraints.Max.Y/2)-trackRowHeight)).Add(gtx.Ops)
|
op.Offset(f32.Pt(0, float32(gtx.Constraints.Max.Y/2)-trackRowHeight)).Add(gtx.Ops)
|
||||||
@ -39,6 +33,9 @@ func (t *Tracker) layoutTrack(patterns [][]byte, sequence []byte, active bool, c
|
|||||||
playSongRow := playPattern*len(patterns[0]) + playRow
|
playSongRow := playPattern*len(patterns[0]) + playRow
|
||||||
op.Offset(f32.Pt(0, (-1*trackRowHeight)*float32(cursorSongRow))).Add(gtx.Ops)
|
op.Offset(f32.Pt(0, (-1*trackRowHeight)*float32(cursorSongRow))).Add(gtx.Ops)
|
||||||
for i, s := range sequence {
|
for i, s := range sequence {
|
||||||
|
if cursorPattern == i && active {
|
||||||
|
paint.FillShape(gtx.Ops, activeTrackColor, clip.Rect{Max: image.Pt(trackWidth, trackRowHeight*len(patterns[0]))}.Op())
|
||||||
|
}
|
||||||
for j, c := range patterns[s] {
|
for j, c := range patterns[s] {
|
||||||
songRow := i*len(patterns[0]) + j
|
songRow := i*len(patterns[0]) + j
|
||||||
if songRow == playSongRow {
|
if songRow == playSongRow {
|
||||||
@ -51,11 +48,7 @@ func (t *Tracker) layoutTrack(patterns [][]byte, sequence []byte, active bool, c
|
|||||||
if songRow == cursorSongRow {
|
if songRow == cursorSongRow {
|
||||||
paint.ColorOp{Color: trackerActiveTextColor}.Add(gtx.Ops)
|
paint.ColorOp{Color: trackerActiveTextColor}.Add(gtx.Ops)
|
||||||
} else {
|
} else {
|
||||||
if cursorPattern == i {
|
paint.ColorOp{Color: trackerInactiveTextColor}.Add(gtx.Ops)
|
||||||
paint.ColorOp{Color: trackerTextColor}.Add(gtx.Ops)
|
|
||||||
} else {
|
|
||||||
paint.ColorOp{Color: trackerInactiveTextColor}.Add(gtx.Ops)
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
op.Offset(f32.Pt(patmarkWidth, 0)).Add(gtx.Ops)
|
op.Offset(f32.Pt(patmarkWidth, 0)).Add(gtx.Ops)
|
||||||
widget.Label{}.Layout(gtx, textShaper, trackerFont, trackerFontSize, valueAsNote(c))
|
widget.Label{}.Layout(gtx, textShaper, trackerFont, trackerFontSize, valueAsNote(c))
|
||||||
|
@ -2,6 +2,7 @@ package tracker
|
|||||||
|
|
||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
|
"image/color"
|
||||||
"sync"
|
"sync"
|
||||||
|
|
||||||
"gioui.org/font/gofont"
|
"gioui.org/font/gofont"
|
||||||
@ -180,6 +181,7 @@ func New(audioContext sointu.AudioContext) *Tracker {
|
|||||||
ticked: make(chan struct{}),
|
ticked: make(chan struct{}),
|
||||||
closer: make(chan struct{}),
|
closer: make(chan struct{}),
|
||||||
}
|
}
|
||||||
|
t.Theme.Color.Primary = color.RGBA{R: 64, G: 64, B: 64, A: 255}
|
||||||
go t.sequencerLoop(t.closer)
|
go t.sequencerLoop(t.closer)
|
||||||
if err := t.LoadSong(defaultSong); err != nil {
|
if err := t.LoadSong(defaultSong); err != nil {
|
||||||
panic(fmt.Errorf("cannot load default song: %w", err))
|
panic(fmt.Errorf("cannot load default song: %w", err))
|
||||||
|
Loading…
x
Reference in New Issue
Block a user